In: Sum[f[i], {i, 1, 5, 2}]
Out: f[1] + f[3] + f[5]
Hey everyone:
So, there are some infinite sums that I would like to see computed out to around 20 terms, just so I can kind of see what form its taking. The problem is that it's a bit difficult to do by hand, and I'll be changing the parameters several times which means I would have to do it several times. I was wondering if there was any way to do it in sage. The type of thing I want would be like \sum_{k=1}^{20} (5^k)(y_k). So, the part that I don't know how to do is have it output y_k. I don't even necessarily need it to generate y_k as a variable that I can plug things in to, I just want it to output it so that I can see the form of the equation, if that makes sense. Thank you!
y1 + y10 + y11 + y12 + y13 + y14 + y15 + y16 + y17 + y18 + y19 + y2 + y20 + y3 + y4 + y5 + y6 + y7 + y8 + y9Also, running it with
So, the order is a bit messed up. I wasn't sure if there was an easy way to fix that.
R.<y> = InfinitePolynomialRing(QQ)
sum([5^k*y[k] for k in [1..20]])
Thanks for the quick reply! Could you explain, or tell me what to search, what exactly "SR("y%s"%i)" does?
Is SR Symbolic Ring? Also, the output for the sum is close to perfect, though it gives me:y1 + y10 + y11 + y12 + y13 + y14 + y15 + y16 + y17 + y18 + y19 + y2 + y20 + y3 + y4 + y5 + y6 + y7 + y8 + y9
So, the order is a bit messed up. I wasn't sure if there was an easy way to fix that.
Also, running it with
R.<y> = InfinitePolynomialRing(QQ)
sum([5^k*y[k] for k in [1..20]])
Seems to run for a very long time