When I want to sum over indexed variables, indices being subscripts, the result works as expected, however, upon loading the Notation package, it doesn't. See below
As one might have expected from the notation package, the subscript "n" does not change its values inside the sum. In this case however, it is clear that this would be wanted. Is there a way to achieve this?
I tried the following:
ClearNotations[]
mysum = Sum[Subscript[f,n],{n,0,2}]
Symbolize[ParsedBoxWrapper[SubscriptBox["_","_"]]]
where the Subscript[f,n]
is done via Ctrl+_. Unfortunately, doing something like:
mysum /. Subscript[f,0] -> 1
where, again, I used Ctrl+_, then the rule does not apply! Looking at FullForm
of test, I can see why, in that the output is:
Subscript[f, 0]
instead of:
f\[UnderBracket]Subscript\[UnderBracket]0
In the worst case scenario, I can live with instead defining Summation "in the usual way" as:
mysumnew = Sum[f[n],{n,0,2}]
if there is a way to automatically "pretty print" the f[n]
as subscripts. Unfortunately, it is not possible to do:
mysumnew /. f[n_] -> Subscript[f,n]
as the subscripts are all symbolized and Mathematica will therefore literally replace all the terms f[0]
, f[1]
and f[2]
with Subscript[f,n]
!