A MILLION digits of Pi with 77 Lines of Code (Pi-day Special)

Опубликовано: 21 Июнь 2026
на канале: Polymath Unlimited
863
37

Happy Pi-day everyone! Did you know you can compute Pi to high accuracy with just integers? In this video, we dive into a spigot algorithm for computing pi, which computes digits of pi sequentially, one after another, using only integer arithmetic. We also write a C++ program to compute the first ONE MILLION DIGITS OF PI!

But how does this algorithm work? Stay tuned as we break it down step by step!

Here's a link to the research paper that the spigot algorithm is based on, in case you want to check it out:

https://www.cs.williams.edu/~heeringa...

VIDEO CHAPTERS

00:00 - Introduction
00:38 - History of Pi Computation (montage)
01:23 - Spigot Algorithm Explained
03:08 - Why it Works (Mixed Radix Representations)
04:08 - Translating the Algorithm to Computer Code
04:56 - Calculating a MILLION digits!
05:48 - Conclusion

DISCLAIMER: This video uses images generated by artificial intelligence.

#pi #piday #c++