# Magic Squares of Prime Numbers

## Description

A prime number magic square is a magic square made up of only prime numbers. As with other magic squares, the sum of the numbers in any row, column, or main diagonal is the same. Unlike normal magic squares, this sum is not a constant for each square order; it can be different for each square.

Some early prime number magic squares contain the number 1, which was considered prime at the time.

## Magic

Order 4 examples: .txt

I
Ernest Bergholt, C. D. Shuldham. Magic sum 102, (lowest, primes with 1). See Andrews, Sayles.
II
Allan. W. Johnson, Jr. Magic sum 120. See Weisstein.
III
Lee Sallows. Magic sum 120, (lowest). See Sallows.
IV
Allan. W. Johnson, Jr. Magic sum 258. Minimum consecutive primes. See Heinz.
V
André Gérardin. (1925) Magic sum 7,588. Numbers are sums of squares. See Boyer.

Orders 5,6,7 examples: .txt

Order 5
Gakuho Abe. Magic sum 313.
Order 6
Akio Suzuki. Magic sum 484.
Order 7
Akio Suzuki. Magic sum 797.

See Suzuki.

See OEIS A164843 for prime magic squares by Andrew Lelechenko, (order 5) and Natalia Makarova, (orders 6 to 14).

## Associative

Order 3 examples: .txt

I
Henry E. Dudeney. (1900) Magic sum 111, (lowest, primes with 1). See Andrews, Sayles.
II
H. A. Sayles. (1918) Magic sum 177, (lowest, all primes). See Sayles.
III
Gakuho Abe. Magic sum 219. See Heinz.
IV
Martin Gardner. Magic sum 411. See Heinz.
V
Rudolph Ondrejka. Magic sum 3,117, (lowest for arithmetic progression). See Weisstein.

Natalia Makarova has associative squares for orders 7 to 20 at OEIS A188537

## Pandiagonal

Order 4 examples, (most-perfect): .txt

I
Charles D. Shuldham. (1914) Magic sum 240. See Boyer.
II
H. A. Sayles. (1918) Magic sum 420. See Sayles.
III
H. A. Sayles. (1918) Magic sum 420. See Sayles.
IV
Allan W. Johnson, Jr. (1979-80) Magic sum 240. See Boyer.

Orders 5, 6, 7 examples: .txt

Order 5
Valery Pavlovsky. Magic sum 395.
Order 6
Order 7
Jarek Wroblewski. Magic sum 733.

See A179440.

 "Pandiagonal Magic Squares of Prime Numbers" has squares for orders 6 to 20. See Zimmermann.

## Ultramagic

Orders 6, 7, 8 examples: .txt

Order 6
Max Alekseyev. Magic sum 990.
Order 7
Natalia Makarova. Magic sum 4,613.
Order 8
Natalia Makarova. Magic sum 2,040.

See OEIS A257316.

## Most-perfect

Orders 4, 6, 8 examples: .txt

Order 4
Magic sum 240.
Order 6
Magic sum 29,790.
Order 8
Magic sum 24,024.

Natalia Makarova. See OEIS A258082.

## Concentric

Orders 7, 8 examples: .txt

Order 7
Allan W. Johnson, Jr. Magic sum 13,853. See Gutierrez.
Order 8
Allan W. Johnson, Jr. Magic sum 19,000. See Heinz.
The nested order 6 is pandiagonal, the order 4 is associative.

From Journal of Recreational Mathematics 15:2, 1982-83, p. 84

Order 13 examples: .txt

I
By a prison inmate. Magic sum 70,681. See Madachy.
The magic sums for the square and sub-squares are:

70,681  59,807  48,933  38,059  27,185  16,311  5,437 with a common difference of 10,874.

II
Bogdan Golunski. Magic sum 85,111. See Golunski.

Bogdan has numerous magic squares on his site including concentric prime number squares of orders:

13, 15, 17, 19, 29, 31, 35, 61, 107, 125, 145, 231, 351, 453, 469, 503

Also, an order 259 with all prime numbers except the center 6,999,551, (13 x 53 x 10159).

In 2015, Natalia Makarova made concentric prime magic squares of orders 5 .. 20. See Makarova.
These are minimal 5, 6, 7, 9, 10, 11, 13, 15, 17, 19 and other 6, 8, 12, 14, 16, 18, 20.
The magic sums are:

```
5       6       7       9       10       11       13       15       17       19
------- ------- ------- ------- -------- -------- -------- -------- -------- --------
1,255    504    4,487   12,249   4,200   26,521   49,439   74,595   128,197  191,159

6       8       12      14       16       18       20
------- ------- ------- -------- -------- -------- --------
630    2,040   8,820   16,170   21,840   35,910   54,600
```

Orders 5, 6, 7 minimal examples:

## Bimagic

Orders 8, 11 examples: .txt

Order 8
Nicolas Rouanet (2018). Magic sums 3,120 and 1,631,000.
Order 11
Christian Boyer (2006). Magic sums 3,497 and 1,578,251.
First known bimagic square of primes.

See Boyer. Also, there:

Nicolas Rouanet has bimagic squares of primes for orders 8 to 11, 13, 15 to 25.
Huang Jianchao has bimagic squares of consecutive primes for orders 24 to 28.

##### REFERENCES

A073502 "The smallest magic constant for n X n magic square with prime entries (regarding 1 as a prime)."
https://oeis.org/A073502

A073520 "Smallest magic constant for any n X n magic square made from consecutive primes, or 0 if no such magic square exists."
https://oeis.org/A073520

A164843 "The smallest magic constant of an n X n magic square with distinct prime entries."
https://oeis.org/A164843

A179440 "The smallest magic constant of pan-diagonal magic squares which consist of distinct prime numbers."
https://oeis.org/A179440

A188537 "The smallest constant of an n X n associative magic square composed of distinct primes."
https://oeis.org/A188537

A257316 "Smallest magic constant of ultramagic squares of order n composed of distinct prime numbers."
https://oeis.org/A257316

A258082 "Smallest magic constant of most-perfect magic squares of order 2n composed of distinct prime numbers."
https://oeis.org/A258082

Andrews, W. S. and H. A. Sayles
"MAGIC SQUARES MADE WITH PRIME NUMBERS TO HAVE THE LOWEST POSSIBLE SUMMATIONS."

Boyer, Christian "Bimagic squares of primes" http://www.multimagie.com/English/BimagicPrimes.htm

Dudeney, Henry E. "MAGIC SQUARES OF PRIMES"
https://archive.org/details/AmusementsInMathematicspdf/page/n182/mode/1up

Golunski, Bogdan "Examples of bordered magic squares" http://www.number-galaxy.eu/
(See under: mag. squares\magic squares\ magic squares with all prime numbers)

Gutierrez, Eddie N. "ROTATIONAL VARIANTS OF PRIME SQUARES" http://oddwheel.com/primesquare.html

Heinz, Harvey "Prime Numbers Magic Squares" http://www.magic-squares.net/primesqr.htm

Madachy, Joseph. S. "Mathematics on Vacation"

Makarova, Natalia "Profile"
https://boinc.multi-pool.info/latinsquares/view_profile.php?userid=1

Makarova, Natalia "Concentric magic squares of primes"
http://primesmagicgames.altervista.org/wp/forums/topic/concentric-magic-squares-of-primes/

Sallows, Lee "Minimal 4x4 of primes"