Live data from Hacker News

A formula for the nth digit of πœ‹ and πœ‹^n

arxiv.org

21–30 of 143 posts

Re: A formula for the nth digit of πœ‹ and πœ‹^n

#21

Chatgpt, please write a function in python for the nth digit of pi. Sure, here is a function in Python that calculates the nth digit of Pi using the Chudnovsky algorithm: from decimal import * def nth_digit_of_pi(n): getcontext().prec = n + 1 C = 426880 * math.sqrt(10005) M = 1 L = 13591409 X = 1 K = 6 S = L for i in range(1, n): M = (K ** 3 - 16 * K) * M // i ** 3 L += 545140134 X *= -262537412640768000 S += Decimal…

since this is Python, `nth_digit_of_pi(-1)` should give us the last number of Pi.

Re: A formula for the nth digit of πœ‹ and πœ‹^n

#23
post #13
post #3

Plouffe ... He used to teach in my university. He is a fantastic man. This is serious, he is crazy about numbers. He is one of the guy behind OEIS (oeis.org). That is not the first formula he found about pi and some of the previous one had been used to break world record about the number of known decimals.

Ok, so the method is real but will not be used to break the next world record. Chudnovsky algorithm is better at that task.

Not this one, but algorithms that can calculate the specific digit positions but nothing else are indeed used for world records, mainly for the verification. If two radically different algorithms converge into the same digits at something like the trillionth position then you will have a high confidence for the rest of digits.

Re: A formula for the nth digit of πœ‹ and πœ‹^n

#24
post #21

Chatgpt, please write a function in python for the nth digit of pi. Sure, here is a function in Python that calculates the nth digit of Pi using the Chudnovsky algorithm: from decimal import * def nth_digit_of_pi(n): getcontext().prec = n + 1 C = 426880 * math.sqrt(10005) M = 1 L = 13591409 X = 1 K = 6 S = L for i in range(1, n): M = (K ** 3 - 16 * K) * M // i ** 3 L += 545140134 X *= -262537412640768000 S += Decimal…

since this is Python, `nth_digit_of_pi(-1)` should give us the last number of Pi.

But it's not a list

Re: A formula for the nth digit of πœ‹ and πœ‹^n

#25
post #21

Earlier quoted context omitted.

since this is Python, `nth_digit_of_pi(-1)` should give us the last number of Pi.

But it's not a list

  Traceback (most recent call last):
    File "", line 1, in 
  AttributeError: 'manojlds' object has no attribute 'humour'. Did you mean: 'joke'?

Re: A formula for the nth digit of πœ‹ and πœ‹^n

#26

Chatgpt, please write a function in python for the nth digit of pi. Sure, here is a function in Python that calculates the nth digit of Pi using the Chudnovsky algorithm: from decimal import * def nth_digit_of_pi(n): getcontext().prec = n + 1 C = 426880 * math.sqrt(10005) M = 1 L = 13591409 X = 1 K = 6 S = L for i in range(1, n): M = (K ** 3 - 16 * K) * M // i ** 3 L += 545140134 X *= -262537412640768000 S += Decimal…

Here is an article with an actual implementation https://www.craig-wood.com/nick/articles/pi-chudnovsky/

Re: A formula for the nth digit of πœ‹ and πœ‹^n

#29
post #4
post #2

So does it mean that these pi-calculating competitions & record are now going to devolve to special olympiads in pointless storage capacity? What will the super computers going to do in view of this discovery? Fascinating times for humans as well as for the machines...

Ο€fs: Never worry about data again! - https://github.com/philipl/pifs

this is a great motivating example for the definition of Kolmogorov complexity.

Re: A formula for the nth digit of πœ‹ and πœ‹^n

#30
post #15

The interesting question, I think, is whether this formula can help address the question of the normality of pi: http://en.wikipedia.org/wiki/Normal_number This is particularly exciting because the prevailing opinion had been that we lack the mathematical tools to attack that problem.

Doubting this will help show whether e^pi or pi^e is transcendental.
Post reply on HN