I'm really new with Mathematica, and I could not find a previously question similar to this one.
Is there a way that Mathematica can be made to recognize and treat a subscript letter as variable so that I could write equations like:
$\qquad a_{n} = n + 1 $
and have the evaluation of $a_{5}$ return 6.
Note: I'm actually trying to write equation for commutators like $[L_n,\, L_m] = n - m$
a[n]
instead. $\endgroup$Subscript[a, n_] = n + 1
. $\endgroup$Subscript
which will SURELY cause unwanted troubles elsewhere in Mathematica where subscripts are intended to use with no underlying definition. Modifying built-in symbols is not advised. On the other hand, you can makea[n]
to format as a subscripted symbol that is still interpretable asa[n]
or to whatever it evaluates due to its definition. $\endgroup$