# The best approximation of pi!

**URL:** <https://cl.desmos.com/t/the-best-approximation-of-pi/8347>\
**Category:** Examples\
**Created:** [October 31, 2025, 1:59am UTC](https://cl.desmos.com/t/the-best-approximation-of-pi/8347 "2025-10-31T01:59:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![NTMDev](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/ntmdev/32/7141_2.png) [@NTMDev](https://cl.desmos.com/u/NTMDev)\
**Post date:** [October 31, 2025, 1:59am UTC](https://cl.desmos.com/t/the-best-approximation-of-pi/8347/1 "2025-10-31T01:59:45Z")

</div>

I did some quick research and discovered that the [Chudnovsky algorithm](https://www.desmos.com/calculator/sxxbk5fixs) is the fastest and most accurate way for calculating Pi. But does anyone know how it works?

---

<div class="post-metadata">

**Author:** ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)\
**Post date:** [October 31, 2025, 8:42am UTC](https://cl.desmos.com/t/the-best-approximation-of-pi/8347/2 "2025-10-31T08:42:28Z")

</div>

The explanation of why the Chudnovsky series converges to pi is quite involved:  
it involves Generalized Geometric Series, Ramanujan Series, J-invariants, Fourier Series, Elliptic functions, Modular Groups … and a whole lot more advanced math concepts.  
Some aspects were only understood very recently (2012).  
If you want to start understanding the ideas behind these types of series you may start with Fourier Series and Generalized Geometric Series.

---

<div class="post-metadata">

**Author:** ![NTMDev](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/ntmdev/32/7141_2.png) [@NTMDev](https://cl.desmos.com/u/NTMDev)\
**Post date:** [October 31, 2025, 11:18am UTC](https://cl.desmos.com/t/the-best-approximation-of-pi/8347/3 "2025-10-31T11:18:41Z")

</div>

I’ll pass. 😅 Haha. Maybe I will start smaller and then get somewhere.

---

<div class="post-metadata">

**Author:** ![Cubic\_Sune](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cubic_sune/32/4722_2.png) [@Cubic\_Sune](https://cl.desmos.com/u/Cubic_Sune)\
**Post date:** [November 3, 2025, 5:57pm UTC](https://cl.desmos.com/t/the-best-approximation-of-pi/8347/4 "2025-11-03T17:57:29Z")

</div>

What if you try making the hexadecimal Pi spigot (the one that gives you one digit in base 16, independent from others)?

---

<div class="post-metadata">

**Author:** ![NTMDev](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/ntmdev/32/7141_2.png) [@NTMDev](https://cl.desmos.com/u/NTMDev)\
**Post date:** [January 7, 2026, 4:06pm UTC](https://cl.desmos.com/t/the-best-approximation-of-pi/8347/5 "2026-01-07T16:06:18Z")

</div>

Sorry for the late response @Cubic_Sune but what’s a spigot? Also why would I choose hex over other bases, say binary? Is there an advantage to it? More memory efficient…?

---

<div class="post-metadata">

**Author:** ![Cubic\_Sune](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cubic_sune/32/4722_2.png) [@Cubic\_Sune](https://cl.desmos.com/u/Cubic_Sune)\
**Post date:** [January 7, 2026, 5:34pm UTC](https://cl.desmos.com/t/the-best-approximation-of-pi/8347/6 "2026-01-07T17:34:55Z")

</div>

A spigot function spits out one digit of a number at a time, without needing to know other digits. Essentially, it lets you ask “what is the nth digit of this number?”  
For example, the decimal 5 spigot would be `{n=0:5,0}`.

The hexadecimal pi spigot works great, and the binary one could be constructed from it, but as far as I can tell, it’s difficult to make one for decimal, so I just chose the hexadecimal one. You could, obviously, make it in other bases, though.

Edit: fixed typo

---

<div class="post-metadata">

**Author:** ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)\
**Post date:** [January 7, 2026, 9:07pm UTC](https://cl.desmos.com/t/the-best-approximation-of-pi/8347/7 "2026-01-07T21:07:34Z")

</div>

Here’s the famous BBP algorithm for base 16 digits of pi:  
[https://www.desmos.com/calculator/z7luqnagyx](https://www.desmos.com/calculator/z7luqnagyx)

pi in base 16 = 3.2,4,3,15,6,10,8,8 …

For example D(50) = 4, this means that the 50th digit of pi in base 16 is 4.

there is not any known formula that gives you directly the n-th digit of pi in base 10.
