In a 4x4 magic square all rows, columns and the two main diagonals are distinct 4-digit prime numbers when read in either direction.
Create such a square.
Bonus (d4): same for order-5 magic square and 5-digit primes.
Based on
L. E. Card,Patterns in Primes, JRM 1:2, 1968, pp .93-99,
(In reply to
re(3): From the computer -semi-spoiler by Charlie)
I saw this only after responding to your email in which I did make a note that I had implemented the square root concept, but I hadn't gone further.
The SUB primetest code was an abridgement of code offered @ http://javascriptsource.com/math-related/prime-number.html
which did test everything.
|
Posted by brianjn
on 2012-01-21 20:39:19 |