Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Adding 210 to 199 over and over again, you get 8 more primes that can be arranged together into a 3x3 magic square:

1669 199 1249

619 1039 1459

829 1879 409

Is there any other pairs of numbers such as (210, 199) in the example above?

I asked this question to myself out of sheer curiosity, but couldn't find the right approach to answer it.

share|cite|improve this question
You simply need nine primes in arithmetic progression to be able to do this - the magic square condition is irrelevant since since any $9$ numbers in arithmetic progression can be put into a magic square. – Thomas Andrews Aug 9 '14 at 22:51
Yeah, thanks, the magic number requirement is not crucial, its the consequence... – VividD Aug 9 '14 at 22:55
up vote 8 down vote accepted

Any arithmetic progression of length $n^2$, $n \geq 3$ can be arranged into a magic square (because multiplying all the numbers in a magic square by a constant, or adding a different constant, doesn't affect the magicness of the square, and there are magic squares on $\{1, \dots, n^2\}$ for $n \geq 3$).

The Green-Tao theorem tells us that we can find arbitrarily long arithmetic progressions consisting solely of primes. It follows that there are infinitely many arithmetic progressions of any particular length you like. So you can find infinitely many magic squares consisting of primes in arithmetic progression.

For example, the Wikipedia page I linked to notes that the numbers $468,395,662,504,823 + 205,619 · 223,092,870 · n$ are prime for $0 \leq n \leq 23$. So you could take the first nine of those numbers (or the second through tenth, and so on) and arrange them in a magic square of size $3$, just as you did with the arithmetic progression starting at $199$.

share|cite|improve this answer
So we just need to break the current record by 2 to get a $5\times5$ magic square out of it. – Gerry Myerson Aug 10 '14 at 0:14
@GerryMyerson: Actually there are 25- and 26-long progressions on that page; I just didn't notice them when I was writing this answer... – Micah Aug 10 '14 at 1:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.