# Pieces of Pi

**URL:** <https://boards.straightdope.com/t/pieces-of-pi/325960>\
**Category:** Factual Questions\
**Created:** [October 12, 2005, 8:59pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960 "2005-10-12T20:59:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [October 12, 2005, 8:59pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/1 "2005-10-12T20:59:28Z")

</div>

What’s the longest repeating string of numerals found (so far) in the decimal representation of Pi?

We all know (or have been told) the numerals used to represent Pi (in decimal) never repeat. But there must surely be “strings” of numerals that are found more than once in the decimal representation of Pi.

For example, Pi = 3.14…54…54… or Pi = 3.14…4930495…4930495…

Does anyone know what this longest string of numerals may be?

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [October 12, 2005, 9:08pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/2 "2005-10-12T21:08:43Z")

</div>

> [@ccwaterback](#):
>
> What’s the longest repeating string of numerals found (so far) in the decimal representation of Pi?
> 
> We all know (or have been told) the numerals used to represent Pi (in decimal) never repeat. But there must surely be “strings” of numerals that are found more than once in the decimal representation of Pi.
> 
> For example, Pi = 3.14…54…54… or Pi = 3.14…4930495…4930495…
> 
> Does anyone know what this longest string of numerals may be?

I would think that by definition, because there are always more numbers in new patterns as you continue the expansion, it would be impossible to solve in the general case.

But I’m slightly intrigued. Might go see if there’s anywhere I can download ‘a million digits of pi’ or something and write a few quick programs to see how long a repetition I can track.

---

<div class="post-metadata">

**Author:** ![borschevsky](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@borschevsky](https://boards.straightdope.com/u/borschevsky)\
**Post date:** [October 12, 2005, 9:14pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/3 "2005-10-12T21:14:19Z")

</div>

In the decimal expansion of pi, there must be repetitions of any length you specify. However I don’t know what the record would be for the longest one that’s actually been found.

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [October 12, 2005, 9:31pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/4 "2005-10-12T21:31:36Z")

</div>

Well, 756130190263 appears twice in the first million digits…

---

<div class="post-metadata">

**Author:** ![Earl\_Snake-Hips\_Tucker](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/earl_snake-hips_tucker/32/3269_2.png) [@Earl\_Snake-Hips\_Tucker](https://boards.straightdope.com/u/Earl_Snake-Hips_Tucker)\
**Post date:** [October 12, 2005, 9:42pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/5 "2005-10-12T21:42:17Z")

</div>

Here’s a pi search engine:

[http://www.angio.net/pi/piquery](http://www.angio.net/pi/piquery)

---

<div class="post-metadata">

**Author:** ![Bytegeist](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@Bytegeist](https://boards.straightdope.com/u/Bytegeist)\
**Post date:** [October 12, 2005, 9:44pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/6 "2005-10-12T21:44:13Z")

</div>

> [@borschevsky](#):
>
> In the decimal expansion of pi, there must be repetitions of any length you specify.

That’s true if pi is _normal_, which I don’t believe it’s actually known to be.

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [October 12, 2005, 9:59pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/7 "2005-10-12T21:59:08Z")

</div>

> [@Bytegeist](#):
>
> That’s true if pi is _normal_, which I don’t believe it’s actually known to be.

No, normalcy implies that _every_ sequence appears with the same asymptotic frequency. But because there exist only a finite number (10[sup]n[/sup]) of distinct sequences of n digits, eventually at least one of these sequences must repeat.

---

<div class="post-metadata">

**Author:** ![Bytegeist](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@Bytegeist](https://boards.straightdope.com/u/Bytegeist)\
**Post date:** [October 12, 2005, 10:00pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/8 "2005-10-12T22:00:07Z")

</div>

> [@chrisk](#):
>
> Might go see if there’s anywhere I can download ‘a million digits of pi’ or something and write a few quick programs to see how long a repetition I can track.

**Tucker’s** link leads to the University of Tokyo (FTP), where you can get at least the first 200 million digits.

---

<div class="post-metadata">

**Author:** ![Bytegeist](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@Bytegeist](https://boards.straightdope.com/u/Bytegeist)\
**Post date:** [October 12, 2005, 10:18pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/9 "2005-10-12T22:18:34Z")

</div>

> [@Omphaloskeptic](#):
>
> No, normalcy implies that _every_ sequence appears with the same asymptotic frequency.

Right, so **if there is** a finite sequence of digits that never appears in pi, or even appears just a finite number of times, then pi would not be normal. (There are also other ways of violating normality; I was focussing on just the one.)

Pi is not yet known to be normal, though from all the digits calculated so far, it would be astounding if it weren’t.

> [@](#):
>
> But because there exist only a finite number (10[sup]n[/sup]) of distinct sequences of n digits, eventually at least one of these sequences must repeat.

How is that known to be true?

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [October 12, 2005, 10:25pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/10 "2005-10-12T22:25:36Z")

</div>

> [@Bytegeist](#):
>
> Right, so **if there is** a finite sequence of digits that never appears in pi, or even appears just a finite number of times, then pi would not be normal. (There are also other ways of violating normality; I was focussing on just the one.)

Agreed.

> [@](#):
>
> > [@Omphaloskeptic](#):
> >
> > But because there exist only a finite number (10[sup]n[/sup]) of distinct sequences of n digits, eventually at least one of these sequences must repeat.
> 
> How is that known to be true?

Because in a sequence of 10[sup]n[/sup]+n digits, there are 10[sup]n[/sup]+1 subsequences of n consecutive digits; clearly (since there are only 10[sup]n[/sup] distinct n-digit sequences) at least two of these are equal. As I understand it, this is what the OP is asking for: e.g., the sequence 756130190263, which occurs at digits 447673 and 857982.

---

<div class="post-metadata">

**Author:** ![borschevsky](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@borschevsky](https://boards.straightdope.com/u/borschevsky)\
**Post date:** [October 12, 2005, 10:30pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/11 "2005-10-12T22:30:33Z")

</div>

Because there are 10[sup]n[/sup] possible sequences of length n, and there are more than 10[sup]n[/sup] such sequences in pi. If you want to find a sequence of n digits that is repeated, look at these sets of digits in pi:

1…n  
n+1…2n  
2n+1…3n  
…  
10[sup]n[/sup]n+1…10[sup]n[/sup]n+n

There are 10[sup]n[/sup]+1 of these, so there must be a repitition in there somewhere.

---

<div class="post-metadata">

**Author:** ![Bytegeist](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@Bytegeist](https://boards.straightdope.com/u/Bytegeist)\
**Post date:** [October 12, 2005, 10:35pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/12 "2005-10-12T22:35:47Z")

</div>

> [@Omphaloskeptic](#):
>
> … in a sequence of 10[sup]n[/sup]+n digits, there are 10[sup]n[/sup]+1 subsequences of n consecutive digits; clearly (since there are only 10[sup]n[/sup] distinct n-digit sequences) at least two of these are equal. As I understand it, this is what the OP is asking for: e.g., the sequence 756130190263, which occurs at digits 447673 and 857982.

Ah, all right. I parsed **borschevsky’s** post wrong. I took him to mean, “for any sequence you find in pi, you’ll always be able to find it repeated somewhere”. But that’s not what he was saying; he was saying what you’re saying.

Never mind.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [October 12, 2005, 11:57pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/13 "2005-10-12T23:57:28Z")

</div>

> [@Bytegeist](#):
>
> Pi is not yet known to be normal, though from all the digits calculated so far, it would be astounding if it weren’t.

Why?

Is there any reason to believe that the properties of the decimal representation of pi are similar to the properties of a finite prefix?

---

<div class="post-metadata">

**Author:** ![Bytegeist](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@Bytegeist](https://boards.straightdope.com/u/Bytegeist)\
**Post date:** [October 13, 2005, 2:05pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/14 "2005-10-13T14:05:37Z")

</div>

> [@ultrafilter](#):
>
> Why?
> 
> Is there any reason to believe that the properties of the decimal representation of pi are similar to the properties of a finite prefix?

Very well, let me amend that to: It would be astounding **to me** if pi were discovered not to be normal — especially in an arbitrary base like ten, which was an entirely human choice.

---

<div class="post-metadata">

**Author:** ![Beware\_of\_Doug](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Beware\_of\_Doug](https://boards.straightdope.com/u/Beware_of_Doug)\
**Post date:** [October 13, 2005, 2:20pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/15 "2005-10-13T14:20:35Z")

</div>

“You want a piece of me?” -?

😃

---

<div class="post-metadata">

**Author:** ![Beware\_of\_Doug](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Beware\_of\_Doug](https://boards.straightdope.com/u/Beware_of_Doug)\
**Post date:** [October 13, 2005, 2:21pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/16 "2005-10-13T14:21:42Z")

</div>

“You want a piece of me?” -pi

😃

---

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [October 13, 2005, 2:44pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/17 "2005-10-13T14:44:22Z")

</div>

I remember seeing (in the “pre-computing search” days), 10,000 digits of pi.  
Somewhere in those first 10,000 digits, the number ‘9’ appears six times in a row. (Great place to round it don’t you think?)

---

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [October 13, 2005, 2:58pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/18 "2005-10-13T14:58:14Z")

</div>

Okay, it occurs pretty early in the pi sequence. From digits 762 through 767 you will find the ‘999999’ sequence.

---

<div class="post-metadata">

**Author:** ![Exapno\_Mapcase](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/exapno_mapcase/32/1051_2.png) [@Exapno\_Mapcase](https://boards.straightdope.com/u/Exapno_Mapcase)\
**Post date:** [October 13, 2005, 3:34pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/19 "2005-10-13T15:34:23Z")

</div>

> [@Bytegeist](#):
>
> Very well, let me amend that to: It would be astounding **to me** if pi were discovered not to be normal — especially in an arbitrary base like ten, which was an entirely human choice.

[Eric W. Weisstein. “Normal Number.”](http://mathworld.wolfram.com/NormalNumber.html)

> [@](#):
>
> the first 30 million digits of are very uniformly distributed (Bailey 1988).
> 
> _snip_
> 
> Bailey and Crandall (2001) showed that, subject to an unproven but reasonable hypothesis related to pseudorandom number generators, the constants pi… would be 2-normal…

What’s the likelihood that pi would be normal in base 10 but not absolutely normal?

And what is 2-normal?

---

<div class="post-metadata">

**Author:** ![bonzer](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@bonzer](https://boards.straightdope.com/u/bonzer)\
**Post date:** [October 13, 2005, 3:58pm UTC](https://boards.straightdope.com/t/pieces-of-pi/325960/20 "2005-10-13T15:58:37Z")

</div>

In his 1988 paper on calculating the first 29 million or so places (reprinted in the Borwein’s _Pi: A Source Book_), David Bailey gives a formula for the expected number _M_ of repeats of length _n_ in _d_ digits. This is _M = 10[sup]-n[/sup] d[sup]2[/sup]/2_. (Which should be easy enough to prove, though I haven’t bothered checking.) There’s also a simple formula for the associated variance: _V = 11 M/9_. Neither result is quite exact, but they are good approximations.

The longest repeated sequence Bailey found involved 15 digits, though he doesn’t say what this was or where it was found. That’s about what you’d have expected based on the formulae above.  
Since then, the calculation of the expansion has been pushed out to [1.2 trillion digits](http://mathworld.wolfram.com/PiDigits.html). You’d expect to be finding something like a 24 digit repeat somewhere in that.

[Next page](https://boards.straightdope.com/t/pieces-of-pi/325960.md?page=2)
