Geek Letter PI
My good man Andre N. pointed me to yet another geeky website: http://3.141592653589793238462643383279502884197169399375105820974944592.com/, claiming, my geek-o-meter would peak off the scale when looking at index1.html. There you have the great transcendental number π up to 1’000’000 digits! Bless him!
Now, on a Friday evening, trying to come down from the tediousnes of implementing stuff with Oracle Forms technology, my very own geekiness comes alive - I was wondering whether I would find my name in the first million (and one) digits of PI. Of course you need to map the letters to numbers, e.g. starting from A: 0 to Z: 25.
A first search with Firefox brought nothing. Of course, the page is formatted, hence it is full of newlines that will shield you from numerous potential hits.
Therefore, the first step was to get the number in a usable format. The following code would do just that:
First you need to remove the html stuff though (pre tags and the like). With that in hand I wrote the program to look for my name (and of course other words). The following class does that job:
The class is instantiated with the large number PI as a string. When FindMatch is called, the word gets stored as an array of integers. Then several passes are done, every time each integer is offset by a fixed amount…That way one should have a slightly bigger chance of finding a word while preserving the alphabet characteristics of the word.
Finally, here’s the program that wraps it all up for usability:
Soo, is my name in there? …Here some findings:
- None of my names appear for any offset between 0 and 80. SNIFF…obviously the longer the word, the less chances there are. But with Frank I was hoping…
- Monsieur Andre, you’ll be glad to hear that your first name DOES appear in PI, for several offsets! Way to go!
- The word love does not appear in PI for the first 80 offsets…unlike hate, which appears for numerous offsets. I find this depressing, and I’m kinda hoping, someone finds a bug in my code. I even ran a scan with deep offsets, ignoring the ridiculously small probability of finding love with an offset of 5000, but hey, never give up. Now I am relieved to see that the word **liebe **appears in PI.
And in fact, the ‘word’ lov3 was also found. Which brings us back to Geekdom…
PS…when I loaded the PI page, my processor suddenly shot up to 100% with firefox being the culprit. What was happening - the trusty ol’ process explorer pointed to the Skype Firefox plugin which tries to interpret numbers as phone numbers. It quite obviously became overpowered by all those numbers! :)