How to calculate the double factorial in SageMath?
I would like to implement the square root of 2 power series:
√2=−∞∑n=0(−1)n(2n−3)!!2n×n!
(which I obtained from the Maclaurin series of √1+x with x=1) in SageMath but I cannot seem to find the double factorial function in the SageMath docs. Is there one? I suppose if a double factorial function is not available I could use this method of finding the double factorial that I found on Wolfram MathWorld:
Γ(n+12)=(2n−1)!!2n√π
In my opinion the series is slowly converging to the limit, for instance:
The Taylor polynomial contains the needed coefficients. However even after 400 terms we get relatively big numbers to add, subtract, add...
Ya I'm well aware convergence is an issue. This method with N (number of terms) = 10,000 is only accurate to 6 decimal places. I know a far more convergent method of estimating √2 is Newton's method. Just wanted to give this a try.