PI Revisited - again!
What Andre’s link caused…
One idea that came up from a former colleague of mine, Christoph was to rebase the number PI to 27, allowing for a presentation in the form of letters of the alphabet. His first tackle at this was written in ruby:
pi = 141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609alphabeth = []"a".upto("z") { |x| alphabeth << x}base = alphabeth.lengthtext = []
begin pi, rest = pi.divmod(base) text << alphabeth[rest]end until pi.zero?puts text.reverse.join
A nice way to express what is also presented here at wikipedia.
After doing some research as to how I could rebase arbitrarily large numbers, my search was suddenly halted by a uber-geek page. Once more I had to accept that whatever silly way to waste your time you come up with, someone has done it before you, and even added some icing to the cake. May I present to you Dr. Mike’s Math, where you can search for arbitrary strings within the first 31,415,929 digits of Π. That’s a good start, I’d say! This is so geeky, I would think it is correct.
Consequently, this case is closed. Really. I swear by eiπ!