Category Archives: Popular and Lonely Primes

Popular-Lonely primes understood


While reading standup mathematician Matt Parker‘s book Things to Make and do in Fourth Dimension, I found answer (on pp. 146) to the question I raised 7 months ago.


When the grid happens to be a multiple of 6 wide, suddenly all primes snap into dead-straight lines. All primes (except 2 and 3) are one more or less than a multiple of 6. (© Matt Parker, 2014)

He also proves the following surprising theorem:

The square of every prime number greater than 3 is one more than a multiple of 24.

Let p be an odd prime not equal to 3. Now we subtract one from the square of this prime number. Therefore, we wish to prove that p^2-1=(p-1)(p+1) is a multiple of 24.

Note that, p^2-1 is a product of two even numbers. In particular, one of these two even numbers must be a multiple of 4, as they are consecutive even numbers and every other even number is divisible by 4. Hence we conclude that p^2-1 is divisible by 8. 

Observe that exactly one of three consecutive numbers, p-1,p,p+1 must be divisible by 3. Since p is an odd prime different from 3, one of p-1 or p+1 must be divisible by 3. Hence we conclude that p^2-1 is divisible by 3.

Combining both the conclusions made above, we complete proof of our statement (since 2 and 3 are coprime).

Edit[19 April 2017]: Today I discovered that this theorem is exercise 68 in “The USSR Olympiad Problem Book“.

Primes: popular and lonely


ulam While doodling in class, I made a 10 x 10 grid and filled it with numbers from 1 to 100. The motivations behind 10 x 10 grid was human bias towards the number 10.

New Doc 10_1

Then inspired by Ulam Spiral, I started creating paths (allowing diagonal, horizontal and vertical moves) starting from the smallest number. Following paths emerged:

  • 2→ 3 →13 → 23
  • 2 → 11
  • 7 → 17
  • 19 → 29
  • 31 → 41
  • 37 → 47
  • 43 → 53
  • 61 → 71
  • 73 → 83
  • 79 → 89

So, longest path is of length 4 and others are of length 2.

The number 2 is special one here, since it leads to two paths. I will call such primes, with more than one paths, popular primes.

Now, 5, 59, 67 and 97 don’t have any prime number neighbour. I will call such primes, with no neighbour, lonely primes.

I hope to create other b \times b grids filled with 1 to b^2 natural numbers written in base b. Then will try to identify such lonely and popular primes.

If you find this idea interesting, please help me to create such grids.