Can you Predict the Next Prime Number?

Bill Lauritzen
3 min readSep 25, 2022

--

by Bill Lauritzen

Ulam Spiral

I was once teaching some middle school students math at an exclusive private school. I had one student who was annoying me and the other students. The administration was not supportive of my attempts at disciplining him. I came up with this solution:

I told him if he could find a pattern to prime numbers, so that he could predict the next one, he could make a lot of money and be famous. He liked this challenge and began devoting himself to it. He had pages and pages of calculations and never bothered me again. Every once in awhile I would show some interest in his work and he would say something like, “I think I’m on to something…”

I knew he would not find anything, because I knew that there is no pattern to prime numbers. There may be some local areas where it appears that there is a pattern, but there is no overall pattern and no formula for predicting the next prime number without testing.

Think of it this way. You are a Paleolithic man who figures out that 2, 3, 5, 7, 11, and 13 are prime. You wonder what the next prime will be. There is no way to find it without some testing. You can test 14. Nope. 15, Nope. 16, Nope. 17, Bingo.

You only need test the factors up to the square root of the number (in the case of 17: 2, 3, and 4) because the next number will be too big, but you do need to test. This testing takes a long time computationally. This is the current basis of cryptography. If we could predict the next prime all our passwords would be naked.

Mathematicians seem to hate to admit that there is this chaos in the middle of numbers, but there is, and I find it lovely. How do I know that there is no pattern? Pattern: a regular and intelligible form or sequence discernible in certain actions or situations.

So a pattern implies regularity or repetition. Repetition implies multiplication, which is repetitive addition. However, multiplication implies factors, and we can’t have factors if it’s prime. Compute: determine (the amount or number of something) mathematically. However, we do not determine if a number is prime mathematically. We do it experimentally.

Primes don’t have a pattern but appear to have certain tendencies. They tend to become more sparse as the quantities increase, but then suddenly … you see two together. These are called twin primes. Examples: (41, 43), (137, 139). Nobody knows if twin primes, like primes, are infinite. It hasn’t been proven yet. Like with the primes themselves, there is no way to predict when these twin primes will come along. (Wikipedia: “The current largest twin prime pair known is 2996863034895 · 2¹²⁹⁰⁰⁰⁰ ± 1, with 388,342 decimal digits. It was discovered in September 2016.”)

Some people think that there are “patterns” in the Ulam Spiral. However, if you examine the figure carefully, you will see some straight lines emerge and then disappear. Since prime numbers are infinite some straight lines will appear at times; just like when flipping coins you will sometimes get a large run of heads. (Also, the Ulam Spiral uses squares. I think a different Spiral will appear if you use other area-filling shapes: triangles or hexagons.)

Science is about finding patterns in order to predict. We can predict when the next lunar eclipse will be, we can predict when the sun will rise tomorrow, we can predict when water will freeze and boil, but we cannot predict the next prime number.

Summary: You may be able to pick up the snake, but you don’t know which way it will twist.

--

--