A new house number ...
thelastdanishpastry.deviantart.com
thelastdanishpastry.deviantart.com
>> 1/((1..1000000).map{|n| (1/((n*3.14)**2))}.inject{|a,b| a+b})
=> 5.99392169730553 >>> from math import pi
>>> 1/sum( [1/(pi*n)**2 for n in xrange(1,1000)] )
6.00365160802217Compare this with sum() + "for n" and "xrange". Also if I remember some Python correctly "xrange" is almost like "range" but it's something like a lazy version, another ad-hoc stuff.
Sorry, didn't resisted.
>>> from math import pi
>>> add = float.__add__
>>> def f(x): return (pi*x)**(-2)
>>> 1/reduce(add, map(f,range(1,1000)) )
6.0036796863530508
Or, as a one-liner: >>> 1/reduce(float.__add__, map(lambda x:1.0/(3.1416*x)**2,range(1,1000)) )
People who aren't mathmos often find the list comprehensions more comprehensible, hence the version I wrote not as a competitor, but as an alternative, to yours.Horses for courses. Personally, I've found the Python version to look more like math when I choose to express it like math, but I'm programming, so why not make it look like what I'm doing? Golf is a stupid game in programming. Understandability is the goal, but different readers find different things natural.
That's never going to go away.
Prelude> 1/sum ([1..1000] >>= \x -> [(pi*x)**(-2)])
6.003647956020607Euler's original paper:
http://www.17centurymaths.com/contents/euler/e041tr.pdf
The bottom of this page has a more modern treatment, although it takes a lot for granted:
http://www.math.wpi.edu/IQP/BVCalcHist/calc3.html
Another treatment of Euler's proof is here:
http://library.thinkquest.org/28049/Summing%20reciprocals.ht...
Seriously, I'd get that changed. There are plenty of reasons someone might want to find your house quickly.
In some/many places, one could find that house by interpolation. (In the US, even numbers tend to be on one side of the street and odd numbers on the other. And they're almost always in-order.) With an apartment, things can be more complicated.
That said, there are instances of "vanity addresses", where "<some number> 5th Ave" appears to not be on 5th Ave.
I don't know what one does in Japan, where the numbers are supposedly assigned chronologically. (Hmm - I wonder what triggers number generation and if they ever reuse or allow transfers.)
http://equationater.com/3887e31ec88fbf35d331554e06353358.png
I think it's a reasonable part of the game to put the pi on the inside.