A166113
Center element of a 3 X 3 magic square composed of consecutive primes.
Original entry on oeis.org
1480028171, 1850590099, 5196185989, 5601567229, 5757284539, 6048371071, 6151077311, 9517122301, 19052235889, 20477868361, 23813359697, 24026890201, 26748150313, 28519991429, 34821326161, 44420969951, 49285771751, 73827799051, 73974781931, 74220519391, 76483907879, 76560277051, 80143089671, 85892025269, 89132925809, 95515449079, 99977424731
Offset: 1
A272386
Smallest primes of 5 X 5 magic squares formed from consecutive primes.
Original entry on oeis.org
13, 59, 79, 97, 107, 127, 157, 269, 337, 347, 439, 457, 479, 563, 601, 631, 719, 743, 883, 947, 1021, 1031, 1049, 1051, 1061, 1093, 1109, 1171, 1201, 1223, 1499, 1523, 1601, 1669, 1811, 1901, 1933, 1997, 2011, 2053, 2153, 2207, 2341, 2399, 2531, 2539, 2549, 2551
Offset: 1
The smallest 5 X 5 magic square that can be formed from 25 consecutive primes consists of the primes 13 through 113, so the first term is 13:
n = 1
|----|----|----|----|----|
| 13 | 107| 73 | 101| 19 |
|----|----|----|----|----|
| 97 | 17 | 79 | 37 | 83 |
|----|----|----|----|----|
| 41 | 53 | 109| 43 | 67 |
|----|----|----|----|----|
| 103| 89 | 29 | 61 | 31 |
|----|----|----|----|----|
| 59 | 47 | 23 | 71 | 113|
|----|----|----|----|----|
The next smallest consists of the primes 59 through 179, so the second term is 59:
n = 2
|----|----|----|----|----|
| 59 | 163| 151| 137| 67 |
|----|----|----|----|----|
| 149| 61 | 79 | 109| 179|
|----|----|----|----|----|
| 113| 83 | 173| 107| 101|
|----|----|----|----|----|
| 167| 139| 71 | 127| 73 |
|----|----|----|----|----|
| 89 | 131| 103| 97 | 157|
|----|----|----|----|----|
-
A272386(n)=MagicPrimes(A176571(n),5)[1] \\ See A073519 for MagicPrimes(). - M. F. Hasler, Oct 28 2018
-
is_candidate(p)={denominator(p=A173981(,p))==1 && bittest(p,0)} \\ For p < 167, this yields exactly the terms of A272386. Exceptions (primes satisfying this but not in A272386) are (167, 227, 383, 461, 607, ...). - M. F. Hasler, Oct 30 2018
A245721
The set of 16 consecutive primes forming a 4 X 4 pandiagonal magic square with the smallest magic constant, 682775764735680 = A256234(1).
Original entry on oeis.org
170693941183817, 170693941183847, 170693941183859, 170693941183861, 170693941183889, 170693941183891, 170693941183903, 170693941183907, 170693941183933, 170693941183937, 170693941183949, 170693941183951, 170693941183979, 170693941183981, 170693941183993, 170693941184023
Offset: 1
A pandiagonal magic square formed by these primes:
170693941183817 170693941183933 170693941183949 170693941183981
170693941183979 170693941183951 170693941183847 170693941183903
170693941183891 170693941183859 170693941184023 170693941183907
170693941183993 170693941183937 170693941183861 170693941183889
A Stanley antimagic square formed by these primes:
170693941183817 170693941183859 170693941183907 170693941183949
170693941183847 170693941183889 170693941183937 170693941183979
170693941183861 170693941183903 170693941183951 170693941183993
170693941183891 170693941183933 170693941183981 170693941184023
Cf.
A320874 (the square made of the set of primes given here).
Cf.
A210710: Minimal index of a Stanley antimagic square of order n consisting of distinct primes.
Cf.
A073520: Smallest magic sum of a magic square made of n^2 consecutive primes.
Cf.
A104157: Smallest of n X n consecutive primes forming a magic square.
Cf.
A256234: Magic sums of 4 X 4 pandiagonal magic squares of consecutive primes.
A272387
Smallest primes of 6 X 6 magic squares formed from consecutive primes.
Original entry on oeis.org
7, 41, 47, 59, 67, 137, 149, 151, 173, 181, 191, 199, 229, 241, 257, 277, 283, 313, 409, 421, 499, 503, 509, 631, 701, 709, 829, 887, 907, 971, 977, 983, 1013, 1019, 1033, 1049, 1051, 1061, 1201, 1223, 1229, 1321, 1439, 1451, 1459, 1489, 1493, 1523, 1531, 1549
Offset: 1
Cf.
A177434 (magic sums, 6 X 6 consecutive primes).
-
A272387(n)=MagicPrimes(A177434(n),6)[1] \\ See A073519 for MagicPrimes(). - M. F. Hasler, Oct 28 2018
-
is_candidate(p,N=6)={denominator(p=A177434(,p,N))==1 && !bittest(p-N,0)} \\ This necessary condition is also sufficient for all primes up to and beyond the limit of the terms displayed in DATA. - M. F. Hasler, Oct 30 2018
A265614
A set of nine consecutive primes forming a 3 X 3 semimagic square with the smallest magic constant (65573).
Original entry on oeis.org
21821, 21839, 21841, 21851, 21859, 21863, 21871, 21881, 21893
Offset: 1
The semimagic square is
|-----|-----|-----|
|21821|21859|21893|
|-----|-----|-----|
|21871|21863|21839|
|-----|-----|-----|
|21881|21851|21841|
|-----|-----|-----|
A320876
Lexicographically first 6 X 6 pandiagonal magic square made of consecutive primes with the smallest magic constant (930).
Original entry on oeis.org
67, 139, 241, 73, 199, 211, 193, 233, 97, 167, 103, 137, 71, 113, 191, 131, 227, 197, 251, 181, 89, 229, 101, 79, 109, 157, 163, 151, 127, 223, 239, 107, 149, 179, 173, 83
Offset: 1
The magic square is
[ 67 139 241 73 199 211]
[193 233 97 167 103 137]
[ 71 113 191 131 227 197]
[251 181 89 229 101 79]
[109 157 163 151 127 223]
[239 107 149 179 173 83]
- Allan W. Johnson, Jr., Journal of Recreational Mathematics, vol. 23:3, 1991, pp. 190-191.
- Clifford A. Pickover, The Zen of Magic Squares, Circles and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002.
-
/* the following transformation operators for matrices, together with transposition, allow the production of all variants of a (pandiagonal) magic square */
REV(M)=matconcat(Vecrev(M)) \\ reverse the order of columns of M
FLIP(M)=matconcat(Colrev(M)) \\ reverse the order of row of M
ROT(M,k=1)=matconcat([M[,k+1..#M],M[,1..k]]) \\ rotate left by k (default: 1) columns
ALL(M)=Set(concat(apply(M->vector(#M,k,ROT(M,k)),[M,M~,REV(M),REV(M~),FLIP(M),FLIP(M~)]))) \\ PARI orders the set according to the (first) columns of the matrices, so one must take the transpose to get them ordered according to elements of the first row.
MagicPrimes(S=930,n=6,P=[nextprime(S\n)])={S=n*S-P[1];for(i=1,-1+n*=n,S-=if(S>(n-i)*P[1],P=concat(P,nextprime(P[#P]+1));P[#P],P=concat(precprime(P[1]-1),P);P[1]));if(S,-P,P)} \\ The vector of n^2 primes whose sum is n*S (= A073523 for default values), or a negative vector of "best approximation" if there is no exact solution.
A217568
Rows of the 8 magic squares of order 3 and magic sum 15, lexicographically sorted.
Original entry on oeis.org
2, 7, 6, 9, 5, 1, 4, 3, 8, 2, 9, 4, 7, 5, 3, 6, 1, 8, 4, 3, 8, 9, 5, 1, 2, 7, 6, 4, 9, 2, 3, 5, 7, 8, 1, 6, 6, 1, 8, 7, 5, 3, 2, 9, 4, 6, 7, 2, 1, 5, 9, 8, 3, 4, 8, 1, 6, 3, 5, 7, 4, 9, 2, 8, 3, 4, 1, 5, 9, 6, 7, 2
Offset: 1
The first such magic square is
2, 7, 6
9, 5, 1
4, 3, 8
From _M. F. Hasler_, Sep 23 2018: (Start)
The complete table reads:
[2, 7, 6, 9, 5, 1, 4, 3, 8]
[2, 9, 4, 7, 5, 3, 6, 1, 8]
[4, 3, 8, 9, 5, 1, 2, 7, 6]
[4, 9, 2, 3, 5, 7, 8, 1, 6]
[6, 1, 8, 7, 5, 3, 2, 9, 4]
[6, 7, 2, 1, 5, 9, 8, 3, 4]
[8, 1, 6, 3, 5, 7, 4, 9, 2]
[8, 3, 4, 1, 5, 9, 6, 7, 2] (End)
Cf.
A320871,
A320872,
A320873: inequivalent 3 X 3 magic squares of distinct integers, primes, consecutive primes.
-
squares = {}; a=5; Do[m = {{a + b, a - b - c, a + c}, {a - b + c, a, a + b - c}, {a - c, a + b + c, a - b}}; If[ Unequal @@ Flatten[m] && And @@ (1 <= #1 <= 9 & ) /@ Flatten[m], AppendTo[ squares, m]], {b, -(a - 1), a - 1}, {c, -(a - 1), a - 1}]; Sort[ squares, FromDigits[ Flatten[#1] ] < FromDigits[ Flatten[#2] ] & ] // Flatten
-
A217568=select(S->Set(S)==[1..9],concat(vector(9,a,vector(9,b,[a,b,15-a-b,20-2*a-b,5,2*a+b-10,a+b-5,10-b,10-a])))) \\ Could use that a = 2k, k = 1..4, and b is odd, within max(1,7-a)..min(9,13-a). - M. F. Hasler, Sep 23 2018
A320874
Lexicographically first 4 X 4 pandiagonal magic square made of consecutive primes.
Original entry on oeis.org
170693941183817, 170693941183933, 170693941183949, 170693941183981, 170693941183979, 170693941183951, 170693941183847, 170693941183903, 170693941183891, 170693941183859, 170693941184023, 170693941183907, 170693941183993, 170693941183937, 170693941183861, 170693941183889
Offset: 1
The magic square is
[ 170693941183817 170693941183933 170693941183949 170693941183981 ]
[ 170693941183979 170693941183951 170693941183847 170693941183903 ]
[ 170693941183891 170693941183859 170693941184023 170693941183907 ]
[ 170693941183993 170693941183937 170693941183861 170693941183889 ]
- Allan W. Johnson, Jr., Journal of Recreational Mathematics, vol. 23:3, 1991, pp. 190-191.
- Clifford A. Pickover, The Zen of Magic Squares, Circles and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002.
Cf.
A210710: Minimal index of a Stanley antimagic square of order n consisting of distinct primes.
Cf.
A073520: Smallest magic sum for an n^2 magic square made of consecutive primes.
Cf.
A104157: Smallest of n X n consecutive primes forming a magic square.
Cf.
A256234: Magic sums of 4 X 4 pandiagonal magic squares of consecutive primes.
-
/* the following transformation operators for matrices, together with transposition, allow the production of all (24 for n=4) variants of a (pandiagonal) magic square */
REV(M)=matconcat(Vecrev(M)) \\ reverse the order of columns of M
FLIP(M)=matconcat(Colrev(M)) \\ reverse the order of rows of M
ROT(M,k=1)=matconcat([M[,k+1..#M],M[,1..k]]) \\ rotate left by k (default: 1) columns
ALL(M)=Set(concat(apply(M->vector(#M,k,ROT(M,k)),[M,M~,REV(M),REV(M~),FLIP(M),FLIP(M~)]))) \\ PARI orders the set according to the (first) columns of the matrices, so one must take the transpose to get them ordered according to elements of the first row.
\\ The set of primes is A245721=MagicPrimes(682775764735680,4), cf. A073519.
A174092
Primes p = -83 + n * 30 (n = 0, 1, ..., 8) forming "optimal" 3 x 3 Magic Prime Square.
Original entry on oeis.org
-83, -53, -23, 7, 37, 67, 97, 127, 157
Offset: 1
Ulrich Krug (leuchtfeuer37(AT)gmx.de), Mar 07 2010
- E. Dudeney: Amusements in Mathematics, Problem 408, New York: Dover, 1970.
- J. S. Madachy: Magic and Antimagic Squares, Madachy's Mathematical Recreations, New York, pp. 85-113, New York: Dover, 1979.
- M. Miller: Geloeste und ungeloeste mathematische Probleme, Leipzig, 1982.
Comments