News for hackers. Stuff that matters.
Re:Why is Pi² so close to 10? by dmitrybrant on Tuesday March 20, 2018 @11:19AM (#16629297)
A much, much more interesting observation (attributed to Ramanujan) is that e^(pi * sqrt(163)) is extremely close to an integer. In fact it equals 262537412640768743.99999999999925...

The most remarkable thing is that this is actually not a coincidence, but a consequence of complex multiplication: https://en.wikipedia.org/wiki/Complex_multiplication#Sample_...

Re:Why is Pi² so close to 10? by TekMol on Tuesday March 20, 2018 @11:42AM (#16629522)

   extremely close to an integer
   it equals 262537412640768743.99999999999925...
Is that really surprising?

The chance that a random number is that close to an integer is about 1:10^12.

So by trying 10^12 crazy formulas you will have one hit. 10^12 possibilites can be covered in about 40 bits.

If we look at "e^(pi*sqrt(163))" as 16 ascii characters, that's 112 bits.

Re:Why is Pi² so close to 10? by jandrese on Tuesday March 20, 2018 @11:31AM (#16629409)
Is the square root of 163 supposed to be a number I recognize? It looks awfully magical in that equation.
Re:Why is Pi² so close to 10? by soVeryTired on Tuesday March 20, 2018 @11:42AM (#16629534)
Nope. It's one of a few very special numbers though.

Every integer has a unique prime factorisation: that's something kids learn in primary school. The idea of factorisation goes a lot deeper though. Define the gaussian integers as integers of the form a + ib, where a and b are intgers. Unique factorisation holds in the Gaussian integers too, but some of the numbers we recognise as prime are no longer prime. For example, 2 = (1 + i)(1 – i).

It turns out unique factorisation is a rare property of number systems. Consider the set of numbers whose ‘integers’ are of the form a + b sqrt(-5), with a and b standard integers. In this system, 6 = 2x3 = (1 + sqrt(-5)) x (1 - sqrt(-5)). But none of those factors can be factorised further, so 6 has two distinct factorisations.

It turns out there are only nine positive numbers n so that unique factorisation holds in the system a + b*sqrt(-n). 163 is the largest!

https://en.wikipedia.org/wiki/Stark%E2%80%93Heegner_theorem

Re:Why is Pi² so close to 10? by ChuckMcM on Tuesday March 20, 2018 @11:53AM (#16629662)
No, 163 is a number substituted into Euler's equation for the value of -1. When you use the square root of -1 in Euler's equation you get back -1. As far as I know there is no other square root of an integer that gives you an integer result. 163 comes close.
Re:Why is Pi² so close to 10? by jbfoo on Tuesday March 20, 2018 @01:53PM (#16630892)
I heard that this is a standard floating point test, if you get non integer value your floating point implementation is subtly broken ;)
Re:Why is Pi² so close to 10? by soVeryTired on Tuesday March 20, 2018 @11:33AM (#16629428)
You're using 'complex multiplication' in a pretty specialised sense there. This isn't your grandma's (a + ib)*(c + id)