Reputation: 61
I need to calculate series (k/m)^2 with k and m from 1 to 100
A = Sum(Sum((k/m)**2, (k, 1, 100)),(m,1,100)) - doesn't work
A = Sum(Sum((k/m)**2, (k, 1, 100)),(m,1,100))
May I do it using only sympy functions?
Upvotes: 1
Views: 71
Reputation: 242
You need to use doit() for sums and then evalf:
evalf
A = Sum(Sum((k/m)**2, (k, 1, 100)),(m,1,100)).doit().evalf()
Returns 553196.802627558
553196.802627558
Upvotes: 2