èƵ

Mathematician’s record-beating formula can generate 50 prime numbers

Figuring out the pattern of the primes is one of the long-standing mysteries of maths, and now there is a way to spit some out on demand

MATHEMATICIANS have spent millennia trying to understand prime numbers – those only divisible by themselves and 1 – but so far no one has discovered a formula for all of them. Now mathematician Simon Plouffe has found a way to produce long sequences of prime numbers, improving on previous efforts.

For example, we have known since the 18th century that n2 + n + 41 is prime for values of n up to 39. It breaks down at n = 40, because that gives 1681, which is equal to 412 and thus not prime.

Other types of prime-generating formulae start with a carefully chosen number and use this to generate a string of primes. If you start with n = 1.92878, calculate 2n and replace n with this new value, you get a sequence of numbers. Ignore everything after the decimal points and the first three numbers in the sequence are prime.

By tweaking the value of n more precisely, you can generate as many primes as you want – but not all of them. That is because the sequence grows too rapidly, skipping many primes and becoming more difficult to calculate. The function described above generates 3 and then 13, skipping 5, 7 and 11. After that, it jumps to 16,381, followed by a prime 4932 digits long – that’s nearly 105000 times bigger.

“We have known since the 18th century that n2 + n + 41 is prime for values of n up to 39”

Plouffe has tried to find something that doesn’t grow too quickly, but will work indefinitely, unlike the n2 + n + 41 example. He starts with a carefully chosen prime number, 10500 + 961, and uses a formula that generates a string of digits that produce a prime about 100,000 times bigger. Applying the formula again produces another prime, again 100,000 times bigger, so the sequence grows reasonably slowly (arxiv.org/abs/1901.01849).

Using this method, Plouffe was able to generate 50 primes – more than any other prime-generating algorithm to date.

Article amended on 25 January 2019

We corrected a typo in the formula n^2 + n + 41

More from èƵ

Explore the latest news, articles and features