There was an interesting post on Reddit for generating a visual representation of the first 100,000 digits of . I modified the code slightly use Brilliant's color palette, and made a variation for producing I ran this code on Ubuntu Linux, but it should work on any Unix-based platform (Linux, OS X, BSD, etc), though you will have to figure out how to install dependencies yourself.
This works by generating 100,000 digits, converting them to color pixels in a 2-step process, and then generating a final image. Here's the result:
100,000 digits of pi
If you'd like to do it yourself, you will need basic command-line tools available on Unix, as well as:
the pi
utility for generating quickly; you could use as the original code does, but it is so slow that it never finished running on my machine and I gave up after ~30 mins.
On Ubuntu, install dependencies like this:
1 |
|
Here's the original code, modified to use Brilliant colors and for faster execution:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
pi
utilityconvert
utility to produce a PNG image pi-100k.png
To produce , modify the code slightly to multiply by 2 using the unix utility bc
:
1 2 3 4 |
|
100,000 digits of tau
Pretty big difference between the two, no? =P
Can you figure out how to generate 1,000,000 digits of or as a 1000x1000 pixel square image?
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
The 3rd digit of PI seems to be wrong in image. Could someone check?
Hi Anton,
I actually made a site a few months ago that builds the first 500,000 digits of pi pixel by pixel.
https://simpleti.me/pi.html
This picture might be based off of it.
how can I get long digits of pi in matlab?
I just found a way to get the value of pi: https://brilliant.org/discussions/thread/i-found-the-value-for-pi-on-my-own