You can see 24,576 digits of circular constant.
You may enjoy the mysterious melody and perform of light generated from the digit sequence.
Operation
Left-Right: Scroll / adjust the auto-scrolling speed
Up: Toggle LED flashing ON / OFF
Down: Toggle sound ON / OFF
B button: Toggle auto-scrolling ON / OFF
Download
Download HEX file.
Or check out souce code and build the project in âpi24kâ folder.
Supplement
The digits are mapped to tones based on this movie.
Also, they are mapped to colors with my subjectivity.
You can modify these mappings by editing soundFigure and/or ledValues in âdata.hâ.
@obono did you know BaileyâBorweinâPlouffe formula that allows to compute nth digit of pi without computing the preceding digits? I wonder if it could be used to allow inspection of many more digits, though am not sure about base 10 (EDIT: looks like base 10 not possible).
Itâll be useless as you canât compute decimal digits, only hexadecimal (i.e. also binary). Anyway, other algorithms could be used to calculate the digits at runtime instead of storing them.
I think the BaileyâBorweinâPlouffe formula works like this (though Iâve now found a faster formula):
The equation tells you pi is a (infinite) sum of various numbers of powers of 16 (which appear as reciprocal, that means the digits come after the decimal point) â i.e. it consists of hexadecimal digits going on forever. k tells you the specific digit, so by substituting k for whatever you get the specific digit, without having to know the previous digits (they donât appear anywhere in the equation). E.g. k = 0 gives you 1/160 = 1 (whole units) and the number in the rounded brackets will get you 47/15 = 3.1333, which tells you there are 3 whole units in pi, i.e. pi starts with 3 (which is the same in decimal as well as hexadecimal). Substituting 1 should give you the next digit after the decimal point (not sure if itâs called decimal point if itâs hexadecimal number ) etc.
It ought to be âhexadecimal pointâ, but thatâs unlikely to be used in common parlance because few people count in hexadecimal.
(The Mayans used a base-20/vigesimal counting sysytem and the Babylonians used base-60/sexagesimal, but as far as Iâm aware no humans have naturally used base-16 for counting.)
Even when humans deal with hexadecimal, theyâll usually either convert to decimal for the sake of doing arithmetic, or rely on a computer to do the arithmetic for them.
If in doubt, use âradix pointâ because itâs correct for any base.
(Something I picked up when writing âA Fixed Point Primerâ.)
I understand the twenty (fingers and toes) but a base-60 system says you and your two friends need to be at the bar to count up the cost of the round you just bought. Actually, that at least means you are not drinking alone.
I like this project because it opens up nice discussions and possibilities of taking it further. For example more irrational constants could be added besides pi (then they would have to be computed at runtime in order to have enough memory), and you could compare how their music sound, and switch between bases. Maybe you could add computation of primes or other integer sequences also. Perhaps the numbers could also be visualized in some way.