I am having problems getting symsum to calculate the following sumation within this equation:
I am using the following code to get pi:
function piram %approximates and prints pi with Ramanujan's formula
%called as piram or piram()
%doesn't return a value, but a print
k=sym('k'); sumpart=symsum((factorial(4*k)*(1103+26390*k))/(((factorial(k))^4)*(396^(4*k))),k,0,inf); inverted=sumpart*((2*sqrt(2))/9801); approxpi=1/inverted; fprintf('Using Ramanujan''s formula, a good approximation is %.6f\n',approxpi)end
Can anyone help with this?
Best Answer