23 ms·
A formula for the nth digit of 𝜋 and 𝜋^n
- _ache_ 4y agoPlouffe ... 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.
- _ache_ 4y agoOk, so the method is real but will not be used to break the next world record. Chudnovsky algorithm is better at that task.
- lifthrasiir 4y agoNot 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.
- tymscar 4y agoAlso wouldnt this be highly parallelizable?
- lifthrasiir 4y agoYes, that fact gave rise to projects like PiHex [1]; hexadecimal digits of pi at around 10^15-th positions were already known in 2000, while the current full-digit record is only for first 10^14 decimal digits. [1] https://en.wikipedia.org/wiki/PiHex https://en.wikipedia.org/wiki/PiHex
- exmadscientist 4y agoProbably this is a good time for your irregular reminder that Plouffe has something of a feud with Bailey and Borwein: https://groups.google.com/g/sci.math.symbolic/c/a3kVKVYJhgc?pli=1 https://groups.google.com/g/sci.math.symbolic/c/a3kVKVYJhgc?... In my very personal opinion, the overall publication history of the three provides some rather good evidence for Plouffe's claims.
- _ache_ 4y agoOh thank you for the link ! In fact, I wasn't sure about the full story but the fact that Wikipedia repeatedly told that Plouffe alone discover the formula makes me think that there is a story behind that.
- tucnak 4y agoSo 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...
- imglorp 4y agoπfs: Never worry about data again! - https://github.com/philipl/pifs https://github.com/philipl/pifs
- oh_sigh 4y agoWe just need a formula that finds a sequence of digits in pi instead of a single one.
- amelius 4y agoYes, we are too much focused on the reverse problem. We know exactly how much time we need to compute the nth digit of pi. But how much time do we need to find a specific string of digits? Seems like a more interesting question.
- adenozine 4y agoThis is one of my favorite software projects of all time. I remember seeing this several years ago and it has driven my imagination crazy since then.
- WithinReason 4y agoBut why?
- imglorp 4y agoFor me, it stimulates a mental shift that could be good exercise elsewhere: instead of storing the string, you find the string somewhere and store its index. It also stimulate the imagination: what other transcendental numbers might this work with? How long do you have to search in the digits to find your string? What can you say about the size of the index (how far you searched) vs your string length? Etc. It's patterns all the way down.
- commandlinefan 4y agoThe paper seems absolutely brilliant, but the grammar is very strange (there’s even what appears to be a typo in the paper where he says “rand n” instead of “rank n”). Odd that he wouldn’t have worked with somebody with better written English before publishing.
- anamexis 4y agoIt isn't published, it's a pre-print.
- xyzzyz 4y agoIf you can download it from arxiv, it is published. Researchers don’t really care whether the paper went through formal peer review and publication process in some journal, because that process is of little value: they can figure out that the author meant rank instead of rand etc.
- eesmith 4y ago"Published" in this context is short for "published to a journal" or more completely for this thread "gone through the full edit cycle you would expect from a paper published to a journal". For example, https://arxiv.org/help/jref https://arxiv.org/help/jref says: > When a article is published, the author may wish to indicate this in the abstract listing for the article. For this reason, the journal reference and DOI (Digital Object Identifier) fields are provided for articles. This can only make sense if "public abstract on arxiv" is not the same as "published" in the way you mean.
- kwhitefoot 4y agoDon't abbreviate unless you have great confidence that everyone hearing or reading your words shares the same dictionary.
- eesmith 4y ago
- scythe 4y agoThe 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 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.
- moloch-hai 4y agoDoubting this will help show whether e^pi or pi^e is transcendental.
- childintime 4y agoChatgpt, 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(M * L) / X K += 12 return +str(S / C)[n] Seems off, but I learned something: https://www.wikiwand.com/en/Chudnovsky_algorithm https://www.wikiwand.com/en/Chudnovsky_algorithm
- leoff 4y agosince this is Python, `nth_digit_of_pi(-1)` should give us the last number of Pi.
- manojlds 4y agoBut it's not a list
- 4gotunameagain 4y agoTraceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'manojlds' object has no attribute 'humour'. Did you mean: 'joke'?
- manojlds 4y ago[flagged]
- deleted 4y ago[deleted]
- mjd 4y agoGenius.
- detrites 4y agoHas anyone converted the formula to code?
- z3t4 4y agohere you go: n => Math.PI.toString()[n+2]
- colanderman 4y agoSee also Plouffe's earlier (1995) formula to extract hexadecimal digits of pi: https://en.m.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula https://en.m.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80...
- karmakaze 4y agoWe should also have decimal/binary/hex digits of Tau to complete the set.
- cleak 4y agoDecimal is the only tricky one. Given that tau=2pi, simple use f(n-1) in the original binary formula for pi, and I’m sure something just as trivial for hex.
- userbinator 4y ago...which Fabrice Bellard improved upon: https://en.m.wikipedia.org/wiki/Bellard%27s_formula https://en.m.wikipedia.org/wiki/Bellard%27s_formula
- NeutralForest 4y agoFinally, we can find the last digit of pi
- detrites 4y agoSpoiler: it's zero, recurring.
- bhk 4y agoThat would make it a rational number, so we can rule that out
- detrites 4y agoExactly, the only possible "last digit" it could have (in keeping with the silly premise that it has one), is zero.
- delaaxe 4y agoWhy is zero different than any other number?
- qorrect 4y agoIt acts as a terminator or terminal, see https://news.ycombinator.com/item?id=34391483 https://news.ycombinator.com/item?id=34391483.
- layer8 4y agoIf 0 would act as a terminator, then 1.203 would be equal to 1.2. The thing that is actually special about the digit 0 is that it is implied for all positions for which no digit is given. That is, when we write 1.2 we really mean …00000001.20000000…
- Flockster 4y agoI don't think that would be true seeing 1/3 = 0.3333.. , or am I reading this wrong?
- tzs 4y agoIn "n’th digit of 𝜋 and 𝜋^n" are both n the same? In other words, for say 𝜋^50 does the formula only give me the 50th digit, or does it give me any arbitrary digit I want?
- dmurray 4y agoThe article title says "powers of 𝜋", so presumably an arbitrary digit.
- mattkrause 4y agoI’m not sure that’s right. The abstract and text say the nth digit of \pi^n, and the worked example on page 2 uses the same n=1000 to find the thousandth digit of \pi^{1000}.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- mattkrause 4y agoIOW, the arXiv title might have lost the "nth" because of some formatting thing. The title inside the PDF says "A formula for nth digit of \pi and \pi^n"
- dmurray 4y agoYes, it looks like you're right. But I don't understand the reasoning - is he actually saying you can use this formula to compute pi^n to n decimal places? So it doesn't produce arbitrary digits on their own, but excellent approximations to pi^n? And this was by taking 4 terms of the zeta function infinite product expansion. 2xn digits would presumably be given by taking more terms (but quite a few, one for every prime under 100, so in some sense this method has bad convergence when you want the mth digit of pi^n and m >> n).
- lyschoening 4y ago> Note that the calculation of Bernoulli numbers can be done in several ways, one of which requires knowing π with good precision This seems to be the catch.
- ashvardanian 4y agoLooks interesting! Does anyone know a practical application where something like this would help?
- chrisshroba 4y agoI believe it can be used to verify calculations of new digits of pi. For example, if you tell me you just computed five trillion digits of pi, I can ask you for specific digits near the end and check that they match what this formula produces
- xoa 4y ago>Does anyone know a practical application where something like this would help? It's another way to help verify super long calculations of pi are correct, and in turn I guess one basic "practical application" of calculating pi to many digits is as part of the suite for verifying new hardware. How do you know that fancy fresh new silicon is actually crunching the numbers correctly, not producing garbage in some subtle way at enough significant digits? While there are lots and lots of checks used to avoid a repeat of hardware bugs of days past (like the forever infamous Pentium FDIV), one simple sanity check/stress test is calculating out numbers like pi a bunch of different ways to huge numbers of digits and making sure the result is always correct. If it's not there's clearly a problem somewhere.
- antiquark 4y agoGood ole Plouffe!
- Maursault 4y agoBut... pi is in the formula. If you already know it, then why bother?
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- davesque 4y agoNot sure where you're seeing that. Did you misread a formula?
- Maursault 4y agoThe very first denominator seen is (2π)^2n, the last denominator on that line is the same, the first denominator of the second line is π^2n+1 and the second denominator in the second line is the same. Are you not seeing that?
- rdlw 4y agoAre you talking about the inequality on the first page? That is at the end of a sentence that starts "The calculation is made from the two inequalities ...". The next sentence is "By isolating π in both cases, we can derive an approximation of the latter." That is not the formula.
- krick 4y agoIt isn't.
- Maursault 4y agoLook at the first denominator seen in both lines of the equation, the last denominator in the first part of the equation, and the second denominator in the second part of the equation.
- telotortium 4y ago𝜋 in the title is a character I haven't seen before, [Mathematical Italic Small Pi](https://unicode-table.com/en/1D70B/ https://unicode-table.com/en/1D70B/).
- Sharlin 4y agoYes, and there's also bold (𝛑), bold italic (𝝅), sans-serif bold (𝝿), and sans-serif bold italic (𝞹), all distinct from the run-of-the-mill Greek Small Letter Pi (π) which is often rendered quite differently from the "standard mathematical pi" in addition to, of course, being semantically different. There's a lot of fun stuff in the Mathematical Alphanumeric Symbols block (https://unicode-table.com/en/blocks/mathematical-alphanumeric-symbols/ https://unicode-table.com/en/blocks/mathematical-alphanumeri...)
- sega_sai 4y agoIt is all curious, but it seems that procedure that calculates the n-th digit using some other functions that require O(n) calculations (i.e. Bernoulli numbers) is not that exciting, as it's just a speedup comparing to a naive calculation (maybe a big one but still). Although because pi is a transcendental number maybe it is impossible to have an algorithm to return the n-th digit in O(1) operations? Does anyone know ? Upd: thinking more about it, just to read all the digits of number n, one needs log(n) operations, so I guess anything that has performance of O(log(n)) can be considered easy (i.e. the digits of rational numbers can be computed in O(logn).
- tooltower 4y agoThe normal method for computing digits of pi is not O(n), so this could still be interesting. I think it's probably better to compare this with the BBP formula [1]. The commonly used algorithm for pi I think still takes O(n log^3 n) time [2] [1] https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%9... [2] https://en.wikipedia.org/wiki/Chudnovsky_algorithm https://en.wikipedia.org/wiki/Chudnovsky_algorithm
- kdkdk 4y agoEven rational numbers which have repeating digits at the end are not O(1) because in order to calculate the n-th digit you need to calculate n modulo k where k is the length until the number repeats its digits, which needs to read the entire input number n (thus runs in O(log(n)). The only exception are rational numbers with k being a power of two. Take 0.1010101010…, you can get the n-th digit by reading off the smallest digit of n and checking whether it is a 0 or a 1. There are transcendental numbers where the n-th digit can be computed in O(log n) like Champerowne constant though.
- ur-whale 4y agoThe interesting question is: are there real numbers whose N-th digit provably cant be calculated in O(N)?
- yongjik 4y ago
- CSMastermind 4y agoWanted to compliment this paper for being well written. I'm not a practicing mathematician but I was able to easily follow along here and that was a cool feeling. Could someone who is a practicing mathematician speak to the practical application of this? From what I understand from reading this seems like an interesting curiosity but the Chudnovsky formula it refers to seems to be better at doing the same thing for any practical purpose.
- saddist0 4y agoSomething like this can be used for "proof of work" in the blockchain world.
- swazzles0 4y agoThat's an interesting point. You could use this to hash values with infinitely scaling difficulty by providing an offset to n where n = difficulty + n. The only issues is collision since the output is always 0-9 but if your POW check is against multiple digits then it might work? Again you could still have potentially infinite repetitions of sequences of digits with different inputs.
- saddist0 4y agoYes, I meant for multiple digits. Basically the work will be give me starting index from which, next N digits are = "45334138023580". Finding the first digit can take ages while verification is O(1)ish. Imagine that to provide storage systems similar to IPFS, but the blockchain network only stores the metadata and no data! https://github.com/philipl/pifs https://github.com/philipl/pifs
- swazzles0 4y agoCool little project, cheers for the link. Definitely a neat concept, would be interested to see it applied like that.
- ars 4y agoThis is a type of https://en.wikipedia.org/wiki/Spigot_function https://en.wikipedia.org/wiki/Spigot_function if you want to lookup more info.
- craigharley 4y agoHere is another const nDigitOfPi = (n) => (22/7).toString()[n+1]
- nico 4y agoIs there a physical limit to how many digits of pi can ever be computed/represented in the universe? For example, let’s say we need one atom for each digit of pi that we want to store, the max limit of digits of pi would be something like the total number of atoms in the universe, minus the atoms required to compute and store the digits. Has that been studied/calculated?
- thom 4y agoThis sounds like a lot of work, when the physical limit of how many decimal places you need in our universe given the Planck length is only 63 or so.
- nico 4y agoWhat do you mean that we “only need” 63 decimal places? A computer can calculate and hold a lot more than 63 digits. So I guess my question is more like: if the universe was just one big computer dedicated only to calculating (and storing) digits of pi, how many digits could it get to calculate, max?
- thom 4y agoThere’s no possible circle in our universe that needs more than those digits of PI for accurate calculations. Obviously it’s fascinating to study Pi for theoretical reasons and I’m sure someone can tell me there are also practical reasons to do so. I was just surprised to find out that, given the Planck length, the practical need for precision is astonishingly low compared to what’s been calculated, even moreso compared to your theoretical upper limit!
- archontes 4y agoCan you think of a more efficient method than encoding pi onto the spin state of every electron?
- paulpauper 4y agoThere is nothing of note here. This paper should be in 'general math', not number theory. You need to know the Bernoulli numbers in order for this to work, which is more computationally difficult than computing pi. So what. Yeah, Plouffe is a famous person in computer science and math, but this does not measure up to the hype. It reminds me of the stuff i tinkered with in high school when i first learned infinite series ..but not publishable-level, sorry.
- dvt 4y ago> but not publishable-level, sorry No one's saying it is, this is arXiv, after all (not a journal). Still a fun little interesting paper, though.
- Someone 4y agoI would think the “explicit expression” part is new and enough to make it publishable, and fail to see why not being useful in practice ever should be a factor in determining whether something is number theory. Now, for the hype, I don’t see any from the authors.
- nyc111 4y agoAre there measurements of pi calculated by meausuring diameter and circumference? How many digits can that pi have?
- deleted 4y ago[deleted]
- OhNoNotAgain_99 4y ago[dead]
- p-e-w 4y agoI don't understand this claim on the bottom of page 1 (emphasis added): > It is easy to verify that with n = 1000, the error on π is of the order of 0.293193 x 10^-303, which is less than 2^-1000. So the thousandth position of this expression is the 1000th bit of the number π. How does that follow? Take the number 1 - 2^-n. The difference between this number and 1 is 2^-n by definition, so it can be made arbitrarily small by varying n, but all bits are wrong. Addition can propagate all the way to the "decimal" point (and even beyond), so an error bound doesn't normally say anything about individual bits or digits. What am I missing here?
- johndcook 4y agoThe paper begins by citing an equation that isn't explicitly in the book referenced. I wrote up some notes filling in a few missing details. https://www.johndcook.com/blog/2023/01/16/pi-bernoulli-numbers/ https://www.johndcook.com/blog/2023/01/16/pi-bernoulli-numbe...