# Mathjax regarding question - how to type "n-1" in subscript/superscript [duplicate]

How can I write a power (n-1) subscript (n-1)

This is what is happening when I try $$(a_(n-1))^(n-1)$$ $$(a_(n-1))^(n-1)$$

• $(a_{n-1})^{n-1}$
– user876009
Aug 22, 2021 at 7:02
• Does this answer your question? MathJax basic tutorial and quick reference
– user876009
Aug 22, 2021 at 7:03
• Additionally, when you see an answer with a mathematical notation you don't know how to replicate, you may simply edit the answer to see the actual code. I learnt quite a few tricks this way. (conversely, it's not difficult to find an answer that exhibits the syntax you are asking for) Aug 23, 2021 at 6:42

You'll need curly braces {}. If you write $(a_{n-1})^{n-1}$ you get $$(a_{n-1})^{n-1}$$. You can use double dollars to get a centered formula; $$(a_{n-1})^{n-1}$$ gives $$(a_{n-1})^{n-1}.$$
If the subscript or superscript is only one character, you do not need them. For example: $a_2^\alpha$ and $a_{2}^{\alpha}$ give the same result: $$a_2^\alpha \qquad\text{vs.}\qquad a_{2}^{\alpha}.$$ The first one needs less characters (less typing).