I understand that π (pi) has an infinite number of digits, and this means any finite sequence of numbers can theoretically be found within its digits. For example, if you're looking for the sequence "20100424," you can find it starting at the 61,822,421st digit of π.

What I want to know is the number of digits needed to find all possible sequences of various lengths (e.g., all 2-digit numbers, all 3-digit numbers), and what the maximum length sequence found so far is, if such information exists.

Here is a clearer explanation of what I'm looking for:

For 1-digit numbers:

You can find all 1-digit numbers (0 through 9) within the first 32 decimal digits of π.

  • 0: Appears at the 32nd digit
  • 1: Appears at the 1st digit
  • 2: Appears at the 6th digit
  • 3: Appears at the 9th digit
  • 4: Appears at the 2nd digit
  • 5: Appears at the 4th digit
  • 6: Appears at the 7th digit
  • 7: Appears at the 13th digit
  • 8: Appears at the 11th digit
  • 9: Appears at the 5th digit

For 2-digit numbers:

  • 00: Appears at the 306th digit
  • ...

For 3-digit numbers:

  • 000: Appears at the [position]
  • ...

I am looking for similar information for sequences of different lengths, and the maximum length sequence found so far.

  • 2
    $\begingroup$ To be clear, "having infinitely many (nonrepeating) digits" is not enough to imply anything along these lines, nor is being irrational or transcendental. The number $1.121221222122221222221222222\dots$ where we alternate between individual $1$'s and ever-increasing lengths of $2$'s is also irrational, yet no $3$ occurs in its decimal expansion. The property you allude to would be if pi is "normal" which is notoriously difficult to prove about any number and has not yet been proven for $\pi$. That said, $\pi$ has been calculated to a great many decimal places and it seems likely. $\endgroup$
    – JMoravitz
    Commented May 15 at 3:19
  • $\begingroup$ As to the specific request of where to find the first occurrence of each $n$... see oeis.org/A014777 , though if you want to go far enough in the sequence you may be best off to code it yourself. $\endgroup$
    – JMoravitz
    Commented May 15 at 3:21
  • 1
    $\begingroup$ I'm confident that somewhere there is a published list of the longest known expansion of $\pi$. Have you attempted anything to answer your own question? It seems the best you could do would be to write a program to search for the sequences you want among such a list. $\endgroup$ Commented May 15 at 3:23
  • 1
    $\begingroup$ You can see this as a case of the coupon collector problem, where the $10^n$ sequences of $n$ digits are the coupons. You would expect to need $10^n \log (10^n) \approx 2.3n10^n$ digits to get all the $n$ digit sequences. This is a big handwave because of the correlations induced by the overlapping of the sequences, but it is pretty close to the numbers Gerry Meyerson gives. $\endgroup$ Commented May 15 at 5:12
  • $\begingroup$ There is a quite nasty statement related to your question regarding the normality of $\pi$: see en.wikipedia.org/wiki/Normal_number. $\endgroup$ Commented May 15 at 6:57

1 Answer 1


https://oeis.org/A332262 tabulates "Maximum position to start a search within the decimal digits of Pi in order to find all numeric strings with length $n$." It goes, $32, 605, 8553, 99846, 1369560, 14118307, 166100500, 1816743905, 22445207398, 241641121039, 2512258603197$

That is, you have to go $32$ places to have all single digits, $605$ places to have all two-digit strings, ..., $2512258603197$ places to have all $11$-digit strings. That's as far as it has been calculated.

It looks like each number is roughly ten times the previous.

  • 2
    $\begingroup$ "It looks like each number is roughly ten times the previous." It looks slightly more and it seems to be steadily increasing. It'd be interesting to evaluate this assuming normal distribution. $\endgroup$
    – fleablood
    Commented May 15 at 4:48
  • $\begingroup$ Yes, my guess is there's a logarithm factor in there. $\endgroup$ Commented May 15 at 7:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .