Formula for Primes, Number of Primes

For a long time, mathematicians had been trying to see if there was a formula that could generate primes, writes Marcus du Sautoy in Music of the Primes. Euler found a curious formula that did just that. Upto a (very small) number. The formula is absurdly easy to understand:

x2 + x + 41, for all values of x from 0 to 39

He then noticed that the formula:

x2 + x + q

would spit out primes if q = 2, 3, 5, 11 and 17 when fed numbers 0 to (q – 2).

 

I was surprised there’s actually a formula for finding all primes. Yes, all primes. Assign any integer values to the 26 letters, a to z. Then calculate the equation below using the values you selected:


If the answer is positive, then that number (the answer) is a prime. The problem with this formula, though, is that it will throw up negative results a lot of the time – those don’t count as prime numbers, obviously. But all the positive ones do. And every single prime can be found via some combo of values assigned to the ‘a’ to ‘z’ letters. Amazing!

~~

 

A different question is whether we can know how many primes lie below any given number. Carl Gauss stumbled onto what seemed to be a pattern when he was using a log tables book:


The pattern is in the last column. From 100 million onwards, the difference in the last column between successive rows seemed to always be 2.3! Was there something to this or was it just coincidence? But if there was a pattern, why was it 2.3, he wondered? Was there any significance to 2.3? There is, if you take the natural logarithm of the numbers in question. For example: loge 100 is 4.605 and loge 1000 = 6.908, giving a difference of about 2.3

 

Gauss didn’t say this formula was exactly correctly, just a good estimate:

Number of primes = N ÷ loge N

Gauss never made a big deal about this finding. Why not? Probably because he wasn’t sure if it was a real pattern, or just a freak coincidence that held upto some range and then fell apart. There was no proof.

 

Others, though, tried to improve on Gauss’ finding. Like Legendre:


For the range that people could test back then, this was definitely an improvement. But the appearance of the “ugly” 1.08366 factor made most mathematicians believe there was a “better and more natural” formula waiting to be found.

 

Gauss himself came up with an even better prediction later, the Prime Number Conjecture:

But it was Bernhard Riemann who came up with the exact formula:

I can’t explain it, but I was amazed that a formula even existed. If you’re interested in understanding the formula and the terms in it, you can check out this site.

Comments

Popular posts from this blog

Student of the Year

The Retort of the "Luxury Person"

Animal Senses #7: Touch and Remote Touch