In 1988 Martin Gardner offered a $100 prize for the first person to produce a magic square filled with consecutive primes. Later that year, Harry Nelson found 22 solutions using a Cray computer.
Gardner said that the square above is “almost certainly the one with the lowest constant possible for such a square.”
It’s easy to verify that the numbers above are consecutive primes. Here’s a little Python code for the job. The function
nextprime(x, i) gives the next
i primes after
x. We call the function with
x equal to one less than the smallest entry in the square and it prints out all the entries.
from sympy import nextprime for i in range(1,10): print( nextprime(148028128, i) )
If you’re looking for more than a challenge, verify whether Gardner’s assertion was correct that the square above uses the smallest possible set of consecutive primes.
By the way, assuming Harry Nelson’s Cray was the Y-MP model that came out in 1988, here are its specs according to Wikipedia:
The Y-MP could be equipped with two, four or eight vector processors, with two functional units each and a clock cycle time of 6 ns (167 MHz). Peak performance was thus 333 megaflops per processor. Main memory comprised 128, 256 or 512 MB of SRAM.
For daily tweets on algebra and other math, follow @AlgebraFact on Twitter.