HOME - Recent Changes - Search:

Academic Work


Personal

* pot de départ


dblp


(:twitter:)

-----

[ edit | logout ]
[ help | sandbox | passwd ]

Memorize the first 15 digits of PI

#############################

Migrated to http://pythonadventures.wordpress.com/2010/09/27/first-15-digits-of-pi/.

Look at this verse:

How I want a drink
alcoholic of course
After the heavy lectures
involving complex functions

Take the length of the words and you get the first 15 digits of PI.

If you don't believe me, then here is the proof:

import sys
import math

s = """
How I want a drink
alcoholic of course
After the heavy lectures
involving complex functions
"""

print [len(w) for w in s.split()]
print math.pi

Output:

[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9]
3.14159265359   # the last digit is rounded here

Read more on PI at http://www.eveandersson.com/pi/.


The PI Song


Other PI-related News

Cloud City


anime | bash | blogs | bsd | c/c++ | c64 | calc | comics | convert | cube | del.icio.us | digg | east | eBooks | egeszseg | elite | firefox | flash | fun | games | gimp | google | groovy | hardware | hit&run | howto | java | javascript | knife | lang | latex | liferay | linux | lovecraft | magyar | maths | movies | music | p2p | perl | pdf | photoshop | php | pmwiki | prog | python | radio | recept | rts | scala | scene | sci-fi | scripting | security | shell | space | súlyos | telephone | torrente | translate | ubuntu | vim | wallpapers | webutils | wikis | windows


Blogs and Dev.

* Ubuntu Incident
* Python Adventures
* me @ GitHub


Places

Debrecen | France | Hungary | Montreal | Nancy


Notes

full circle | km


Hobby Projects

* Jabba's Codes
* PmWiki
* Firefox
* PHP
* JavaScript
* Scriptorium
* Tutorials
* me @ GitHub


Quick Links


[ edit ]

View - Edit - History - Attach - Print *** Report - Recent Changes - Search
Page last modified on 2010 September 27, 19:47