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: x 2 + x + 41 , for all values of x from 0 to 39 He then noticed that the formula: x 2 + 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 th...