To mathematicians: Why does a 9 appear between prime numbers?

Originally published on August 17, 2020. The following text preserves my original visual observation and questions; a later computational check appears below.

My original observation (2020)

I have treated numbers as 0 or 1. If a number is prime, I have assigned it a black circle, and if it is not prime, I have used a white circle instead. A green circle is like a white circle, but accompanied by eight more: together they represent nine consecutive non-prime numbers.

Isn't it odd that, in this sample, the numbers of adjacent white or black circles appear to be prime, except when there are nine white circles together? For example, there are three white circles together, and three is prime. There are five white circles together, and five is prime. There are eleven white circles together, and eleven is prime. There are thirteen white circles together, and thirteen is prime. But nine white circles appear together, and nine is divisible by three.

There are also adjacent black circles: they appear singly or in prime-sized groups, such as three, in this sample. I have not seen prime numbers treated as bits before, and I think this non-prime number, nine, could be a clue to unravelling the mystery of prime numbers. What role does a non-prime number other than one play between prime numbers?

Original diagram of integers 1–281, using black circles for primes, white for non-primes and green to highlight runs of nine non-primes.
Diagram of numbers 1–281, with the circle for 1 corrected from black to white in 2026.


Further investigation

Check whether this pattern continues with larger numbers. Represent prime numbers in binary and look for new patterns.

Update — October 22, 2026

The number 1 is neither prime nor composite. Its circle in the lower diagram has been corrected to white. The apparent group of three black circles at the start was an error in the original image: only 2 and 3 are consecutive prime integers.

A computational check of all primes up to 1,000,000 found 7,079 runs of nine non-prime numbers between consecutive primes. Nine is not the only composite run length: the first different one is 21, between 1129 and 1151.

If p and q are consecutive primes, the number of circles between them is q − p − 1.

Prime pNext prime qCircles between themLength is composite
28329393 × 3
11291151213 × 7
13271361333 × 11
18311847153 × 5
24772503255 × 5
29712999273 × 3 × 3
95519587355 × 7
1,000,4571,000,507497 × 7
1,000,7931,000,829355 × 7
1,001,5011,001,527255 × 5

For example, every integer from 1130 to 1150 is non-prime. The nine-circle pattern is therefore one case among several composite run lengths, rather than a unique exception. Although 9, 15, 21, 27 and 33 share the divisor 3, the lengths 25 and 35 do not.

A further computer search between 1,000,000 and 10,000,000 found 24,927 runs of consecutive non-prime numbers whose lengths were composite but not divisible by three. We counted only runs with both bounding primes inside that range. For example, between the primes 1,000,457 and 1,000,507 there are 49 non-prime numbers: 49 = 7 × 7 is composite and is not divisible by three. The examples above one million shown in the table were also checked separately, one number at a time, using direct division. This confirmed that both endpoints were prime and that every integer between them had a divisor other than 1 and itself, so none of the numbers inside those runs was prime.

One general rule does hold: between consecutive primes greater than 2, the number of non-prime integers is always odd. Both primes are odd, so their difference is even; subtracting one gives an odd run length. This concerns the number of circles, not the parity of each number represented. The pair 2 and 3 has zero integers between it.

Extending the search found a run of 121 = 11 × 11 between the consecutive primes 3,117,299 and 3,117,421, and a run of 143 = 11 × 13 between 11,981,443 and 11,981,587. Every integer from 11,981,444 through 11,981,586 is non-prime. A composite run length therefore need not have a prime factor below ten; it need not have exactly two prime factors either, as 27 = 3 × 3 × 3 shows.

Related article

For another visual experiment with mathematical ideas, read A Tip About a Mathematical Tit: 3D Graphs and Equations, where equations are used to explore three-dimensional shapes.

Comments