Is there any differences among theses sentences? Which one is better?
We show the quantity with n.
We show the quantity as n.
We show the quantity by n.
I am making a wild guess that you mean “We use n to represent the quantity”. If so, none of the three options clearly means that, though 2) and 3) could mean it with enough context.
I would say “We denote (or represent) the quantity by n“.