A Million Digits of Pi in 9 Lines of JavaScript
Can someone explain the logic behind the evolution of the fractions at each stage? I see that (1/4) becomes (1/4^2) and (1/4^3), but it's not obvious to me how (1/3)->(1/5)->(1/7) flows (odds? primes?), or (1/2) -> (13/24) -> (135/246).<p>EDIT: I understand now, the numerator on the first term is ascending odds and the denominator is  ascending evens. Thanks for everyone's help!