Live data from Hacker News

A Million Digits of Pi in 9 Lines of JavaScript

ajennings.net

21–30 of 86 posts

Re: A Million Digits of Pi in 9 Lines of JavaScript

#21

Earlier quoted context omitted.

Safari seems to be consistently behind these days, not sure why.

Apple seems to be the only browser developer that makes user-centric changes first, not developer-centric. I'm OK with that.

Given their $$$ seems like they could do both.

I don't think BigInt is some adtech anti-feature.

Re: A Million Digits of Pi in 9 Lines of JavaScript

#22
post #21

Earlier quoted context omitted.

Apple seems to be the only browser developer that makes user-centric changes first, not developer-centric. I'm OK with that.

Given their $$$ seems like they could do both. I don't think BigInt is some adtech anti-feature.

Safari also does releases less often than Chrome/Firefox. They are behind, but not by that much.

Re: A Million Digits of Pi in 9 Lines of JavaScript

#24
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).

EDIT: I understand now, the numerator on the first term is ascending odds and the denominator is ascending evens. Thanks for everyone's help!

Re: A Million Digits of Pi in 9 Lines of JavaScript

#26

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). EDIT: I understand now, the numerator on the first term is ascending odds and the denominator is ascending evens. Thanks for everyone's help!

odds to get the 1/3, 1/5, 1/7, 1/9, etc. term and count by alternating digits on the numerator and denominator up to the next even number to get 1/2, 13/24, 135/246, 1357/2468, etc for the first term.

equivalently you just list odds on the numerator and evens in the denominator

Re: A Million Digits of Pi in 9 Lines of JavaScript

#27

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). EDIT: I understand now, the numerator on the first term is ascending odds and the denominator is ascending evens. Thanks for everyone's help!

Remove the leading 3 and the trailing term of 1/4 increasing in power.

You are left with this (in the 4th line):

1 3 5 1

- - - -

2 4 6 7

The pattern I see is that, starting from the top left and reading numerator, denominator, numerator, denominator and so on gives: 1 2 3 4 5 6 7 if you ignore the last numerator.

I may have it wrong, but that looks like the pattern.

Re: A Million Digits of Pi in 9 Lines of JavaScript

#28

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). EDIT: I understand now, the numerator on the first term is ascending odds and the denominator is ascending evens. Thanks for everyone's help!

Remove the leading 3 and the trailing term of 1/4 increasing in power. You are left with this (in the 4th line): 1 3 5 1 - - - - 2 4 6 7 The pattern I see is that, starting from the top left and reading numerator, denominator, numerator, denominator and so on gives: 1 2 3 4 5 6 7 if you ignore the last numerator. I may have it wrong, but that looks like the pattern.

4th step is 1357/2468

Re: A Million Digits of Pi in 9 Lines of JavaScript

#29
post #28

Earlier quoted context omitted.

Remove the leading 3 and the trailing term of 1/4 increasing in power. You are left with this (in the 4th line): 1 3 5 1 - - - - 2 4 6 7 The pattern I see is that, starting from the top left and reading numerator, denominator, numerator, denominator and so on gives: 1 2 3 4 5 6 7 if you ignore the last numerator. I may have it wrong, but that looks like the pattern.

4th step is 1357/2468

Is that simplified? I'm just going off of this image: http://ajennings.net/blog/images/formula.png

Re: A Million Digits of Pi in 9 Lines of JavaScript

#30
post #28

Earlier quoted context omitted.

4th step is 1357/2468

Is that simplified? I'm just going off of this image: http://ajennings.net/blog/images/formula.png

me too, the pattern to me is odds on the numerator and evens in the denominator, and the second fraction goes 1/3, 1/5, 1/7, 1/9...

i think we're saying the same thing i misunderstood your comment. 1357/2468 is the first fraction of the NEXT line that isnt in the image

Post reply on HN