# Finding a specific number in Pi

**URL:** <https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972>\
**Category:** Factual Questions\
**Created:** [January 6, 2018, 7:00am UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972 "2018-01-06T07:00:16Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [January 7, 2018, 8:37pm UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/21 "2018-01-07T20:37:18Z")

</div>

[The 40,000th digit is 1.](https://www.youtube.com/watch?v=6FdbqXZukhg) ([Really.](https://www.youtube.com/watch?v=K305Vu7hFg0))

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [January 8, 2018, 10:14pm UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/22 "2018-01-08T22:14:12Z")

</div>

> [@DPRK](#):
>
> 1. The formula given at the top is the hypergeometric identity [sub]2[/sub]F[sub]1/sub = π + 3. What is the clearest (in your opinion) way to see this?

Unless someone has a better idea, I think it is quite reasonable to start with the series for arcsin(√z)/√z , apply Gauss’s relations to lower the indices and a linear transformation to obtain a relatively simple expression for the hypergeometric function in question in terms of arcsin and square roots, and substitute z = 1/2.

Of course, you can use a computer, and I take it one of Plouffe’s ideas is to use mechanical methods to find useful identities, as exemplified by the Inverse Symbolic Calculator mentioned before.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [January 9, 2018, 2:40pm UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/23 "2018-01-09T14:40:37Z")

</div>

> [@](#):
>
> Quoth **GreysonCarlisle** :
> 
> Is there some particular application you want this for? If you’re using it for cryptography or randomness, you could treat the value of pi as text instead of as numeric.

Better idea: If you’re using it for cryptography or randomness, don’t. It’s really hard to produce a good random number generator or cryptography scheme, and when amateurs try, they usually end up leaving gaping holes. Further, it’s not hard to find the random-number generators and cryptography schemes that have been created by the knowledgeable professionals and use those instead. Don’t try to reinvent the wheel.

---

<div class="post-metadata">

**Author:** ![Slash1972](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/slash1972/32/6461_2.png) [@Slash1972](https://boards.straightdope.com/u/Slash1972)\
**Post date:** [January 9, 2018, 2:56pm UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/24 "2018-01-09T14:56:58Z")

</div>

> [@Chronos](#):
>
> If you want it in base 10, the only (known) way to get it is by generating all of the digits out to that point (or by finding someone else who has done so). Amazingly, though, if you want it in base 16 (or base 2 or any other base that’s a power of 2), there’s actually a formula that will find digits individually.

I don’t understand this. Can’t you find the number in base 16 and then just convert to base 10?

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [January 9, 2018, 3:03pm UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/25 "2018-01-09T15:03:30Z")

</div>

To convert a number from base 16 to base 10, you need all of the digits.

---

<div class="post-metadata">

**Author:** ![GreysonCarlisle](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@GreysonCarlisle](https://boards.straightdope.com/u/GreysonCarlisle)\
**Post date:** [January 9, 2018, 8:37pm UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/26 "2018-01-09T20:37:20Z")

</div>

> [@Chronos](#):
>
> Better idea: If you’re using it for cryptography or randomness, don’t. It’s really hard to produce a good random number generator or cryptography scheme, and when amateurs try, they usually end up leaving gaping holes. Further, it’s not hard to find the random-number generators and cryptography schemes that have been created by the knowledgeable professionals and use those instead. Don’t try to reinvent the wheel.

People like to dabble in things that interest them, and professionals had to practice on something while they were still amateurs.

---

<div class="post-metadata">

**Author:** ![GuanoLad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/guanolad/32/42_2.png) [@GuanoLad](https://boards.straightdope.com/u/GuanoLad)\
**Post date:** [January 10, 2018, 4:52am UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/27 "2018-01-10T04:52:34Z")

</div>

[Mile Of Pi](https://www.youtube.com/watch?v=0r3cEKZiLmg). Brady Haran and Matt Parker give some interesting facts on a mile long roll of paper with all the digits of Pi they could fit.

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [January 10, 2018, 9:13am UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/28 "2018-01-10T09:13:00Z")

</div>

> [@Slash1972](#):
>
> I don’t understand this. Can’t you find the number in base 16 and then just convert to base 10?

To expand on this a little, it’s because of the way that number bases place their digits - the digit places in a base 10 number are units, tens, hundreds, etc - in Hex, the’re units, sixteens, two-hundred-and-fifty-sixes, four-thousand-and-ninety-sixes, etc - so there’s no direct relationship between individual digits of a hex number and the individual digits of the same number, in decimal.

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [January 10, 2018, 10:32am UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/29 "2018-01-10T10:32:19Z")

</div>

> [@Mangetout](#):
>
> To expand on this a little, it’s because of the way that number bases place their digits

That’s not universal, though. It’s easy to switch between binary and hexadecimal–4 bits map exactly to one hex digit. No other digits are influenced.

That doesn’t work with decimal\<=\>hex, though, since the factors are different (no factor of 5 in hex). Add 1 to E8D4A50FFF and get E8D4A51000. Most of the digits are the same. In decimal, that changes 999999999999 to 1000000000000–all of the digits are different.

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [January 10, 2018, 10:38am UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/30 "2018-01-10T10:38:30Z")

</div>

> [@Dr.Strangelove](#):
>
> That’s not universal, though. It’s easy to switch between binary and hexadecimal–4 bits map exactly to one hex digit. No other digits are influenced.

It only works in that direction though - you can’t pick out any 4 consecutive binary digits and expect them to map to a hex digit - they have to be digits 1,2,3,4 or 5,6,7,8 etc)

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [January 10, 2018, 10:45am UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/31 "2018-01-10T10:45:06Z")

</div>

True, but 4 consecutive bits affect 2 hex digits at most. That’s unlike decimal-hex, where you can affect most of the digits in the converted string just by changing a single input digit (even if the number is trillions of digits long).

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [January 10, 2018, 11:03am UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/32 "2018-01-10T11:03:18Z")

</div>

> [@Dr.Strangelove](#):
>
> True, but 4 consecutive bits affect 2 hex digits at most. That’s unlike decimal-hex, where you can affect most of the digits in the converted string just by changing a single input digit (even if the number is trillions of digits long).

Agreed - that’s the common factor influence, I think - so (without testing), I expect the same sort of clean-one-way, fairly-clean-the-other relationship between bases 5 and 10

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [January 10, 2018, 5:05pm UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/33 "2018-01-10T17:05:34Z")

</div>

Just to show what some base 16 to base 10 conversions look like (from [here](https://www.rapidtables.com/convert/number/hex-to-decimal.html)):

1FFFFFFFFFFFF9 –\> 9007199254740985  
2FFFFFFFFFFFF9 -\> 13510798882111481  
2FFFFFF8FFFFF9 -\> 13510798764670969

A single digit change can affect all the lower precision digits.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [January 10, 2018, 6:54pm UTC](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972/34 "2018-01-10T18:54:38Z")

</div>

> [@ftg](#):
>
> Just to show what some base 16 to base 10 conversions look like (from [here](https://www.rapidtables.com/convert/number/hex-to-decimal.html)):
> 
> 1FFFFFFFFFFFF9 –\> 9007199254740985  
> 2FFFFFFFFFFFF9 -\> 13510798882111481  
> 2FFFFFF8FFFFF9 -\> 13510798764670969
> 
> A single digit change can affect all the lower precision digits.

Yes, but 1/16 = 0.0625 exactly:

.1FFFFFFFFFFFF9 = .12499999999999990285548534529880271293222904205322…  
.2FFFFFFFFFFFF9 = .18749999999999990285548534529880271293222904205322…  
.2FFFFFF8FFFFF9 = .18749999837018539727839794295505271293222904205322…

So it is not changing single hexadecimal digits that is the problem, since that only affects a known finite number of decimal digits.

[Previous page](https://boards.straightdope.com/t/finding-a-specific-number-in-pi/805972.md?page=1)
