cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

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

Views

Author

Max Alekseyev, Jul 30 2014

Keywords

Comments

Also, the set of 16 smallest consecutive primes forming a 4x4 Stanley antimagic square.
The set of primes is uniquely and straightforwardly determined by the magic sum, here A256234(1), cf. PROGRAM. See A320874 for the ordered list, i.e., the lexicographic smallest magic square made of these primes. - M. F. Hasler, Oct 23 2018

Examples

			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
		

Crossrefs

Cf. A320874 (the square made of the set of primes given here).
Cf. A073519 or A320873, A073521, A073522 (3 X 3, 4 X 4 and 5 X 5 consecutive primes), A073523 and A320876 (6 X 6 consecutive primes, pandiagonal magic square).
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.

Programs

A073520 Smallest magic constant for any n X n magic square made from consecutive primes, or 0 if no such magic square exists.

Original entry on oeis.org

2, 0, 4440084513, 258, 313, 484, 797, 2016, 2211, 2862, 4507, 6188, 6325, 9660, 12669, 13016, 16857, 19530, 23069, 28184, 38761, 46302, 42515, 49846, 59087, 70260, 73385, 78960, 97267, 98316, 111023, 124454, 134641, 152952, 163043, 180596, 195975, 218432, 237623, 293182, 276243, 298868
Offset: 1

Views

Author

N. J. A. Sloane, Aug 29 2002

Keywords

Examples

			A square of order 15 found by _Natalia Makarova_, communicated by Stefano Tognon, Sep 23 2009:
[  131  167  229  461  541  617  733  911  967 1091 1259 1279 1319 1471 1493
   547  907 1583 1613  149 1423  193 1601  941  137  233  389 1039 1283  631
  1019  181  751  163 1453 1301 1297 1277  271 1619 1327  691  277  281  761
  1307  719  359  919 1063  653 1237  269 1433  863 1439  313  191 1021  883
   503 1367  433 1013  829 1153  317  347 1109  491 1249  677 1451 1489  241
   421  311 1487  439 1049 1409 1123  463  409  983  449 1031 1163  373 1559
  1399 1193  419 1531  971  647  977 1051  709  479 1229  379  353 1093  239
   599  953 1213  587  499  727 1321  787  307 1151  157 1571 1033  773  991
   211 1291 1499  577 1087  349  947  467  739  613 1171 1609  173  839 1097
   563  139 1373 1459 1289  443  619 1201 1427  809  881 1303  331  263  569
   607 1607 1511  673 1181 1481 1217  523  661  857  223  743  197  431  757
   853  643  701  179 1483  571  769  859 1447  659  929  997 1223 1129  227
  1549  887  257  557  367 1061  601  337 1361  937 1231  811 1543  293  877
  1579 1187  397 1069  509  683  797 1567  401  383  641  283  823  827 1523
  1381 1117  457 1429  199  151  521 1009  487 1597  251  593 1553 1103 821]
		

References

  • Allan W. Johnson, Jr., Journal of Recreational Mathematics, vol. 14:2, 1981-82, pp. 152-153.
  • Allan W. Johnson, Jr., Journal of Recreational Mathematics, vol. 23:3, 1991, pp. 190-191.
  • H. L. Nelson, Journal of Recreational Mathematics, 1988, vol. 20:3, p. 214.
  • Clifford A. Pickover, The Zen of Magic Squares, Circles and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002.

Crossrefs

Cf. A104157: smallest element in an n X n magic squares of consecutive primes.
Cf. A073519 and A320873 (3 X 3 magic square of consecutive primes), A073521 (consecutive primes of a 4 X 4 magic square), A245721 and A320874 (4 X 4 pandigital magic square of consecutive primes), A073522 (consecutive primes of a 5 X 5 magic square, non-minimal and non-pandiagonal), A073523 and A320876 (6 X 6 pandigital magic square of consecutive primes).
Cf. A256234: magic sums of 4 X 4 pandiagonal magic squares of consecutive primes.

Programs

  • PARI
    A073520(n,p=A104157[n])=sum(i=2,n^2,p=nextprime(p+1),p)/n \\ Assumes a pre-computed array A104157, but can be used to find a(n) and A104157(n) by calculating this for supplied primes p until the result satisfies the condition of the conjecture in FORMULA. - M. F. Hasler, Oct 29 2018

Formula

Conjecture: for n >= 5, a(n) equals the smallest integer of the form (A000040(s+1) + ... + A000040(s+n^2))/n = (A007504(s+n^2) - A007504(s))/n of the same parity as n.
a(2) = 0, otherwise a(n) = (1/n) * Sum_{m=k..n^2+k-1} A000040(m), where k = A049084(A104157(n)). - Arkadiusz Wesolowski, Nov 06 2015
In the above, A049084 could be replaced by A000720 = primepi. - M. F. Hasler, Oct 29 2018

Extensions

a(5)-a(6) corrected and a(7)-a(14) added, from the work of Stefano Tognon and Natalia Makarova, by Max Alekseyev, Sep 23 2009
a(15) from Natalia Makarova, a(16) and further terms from Stefano Tognon
Edited by Max Alekseyev, Oct 13 2009
Edited and more terms (using A104157) from M. F. Hasler, Oct 29 2018

A073523 The set of 36 consecutive primes that form a 6 X 6 pandiagonal magic square with the smallest magic constant (930).

Original entry on oeis.org

67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251
Offset: 1

Views

Author

N. J. A. Sloane, Aug 29 2002

Keywords

Comments

There exist non-pandiagonal 6 X 6 magic squares composed of consecutive primes with smaller magic constant, the smallest being A073520(6) = 484.
Pandiagonal means that not only the 2 main diagonals, but all other 10 diagonals also have the same sum, Sum_{i=1..6} A[i,M6(k +/- i)] = 930 for k = 1, ..., 6 and M6(x) = y in {1, ..., 6} such that y == x (mod 6). - M. F. Hasler, Oct 20 2018
See A320876 for the primes in the order in which they appear in the matrix. - M. F. Hasler, Oct 22 2018

Examples

			The magic square is
  [  67 193  71 251 109 239 ]
  [ 139 233 113 181 157 107 ]
  [ 241  97 191  89 163 149 ]
  [  73 167 131 229 151 179 ]
  [ 199 103 227 101 127 173 ]
  [ 211 137 197  79 223  83 ]
		

References

  • 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.

Crossrefs

Cf. A073519 and A320873 (3 X 3 magic square of consecutive primes), A073521 (consecutive primes of a 4 X 4 magic square), A245721 and A320874 (consecutive primes of a 4 X 4 pandigital magic square), A073522 (consecutive primes of a 5 X 5 magic square, not minimal and not pan-diagonal).
Cf. A256234: magic sums of 4 X 4 pandiagonal magic squares of consecutive primes, A073520: magic sums for n X n squares of consecutive primes.

Programs

Extensions

Edited by Max Alekseyev, Sep 24 2009
Edited by M. F. Hasler, Oct 29 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

Views

Author

M. F. Hasler, Oct 22 2018

Keywords

Comments

This is also the 4 X 4 pandiagonal magic square made of consecutive primes which has the smallest possible magic constant (= sum), 682775764735680 = A256234(1). (In the present case there is no other non-equivalent pandiagonal 4 X 4 magic square having the same magic sum, but this could be possible as for rows 7 and 8 of A320872.)
There exist many non-pandiagonal 4 X 4 magic squares composed of consecutive primes with much smaller magic constant, the smallest being A073520(4) = 258.
Pandiagonal means that not only the 2 main diagonals, but also the 6 other "broken" diagonals all have the same sum, Sum_{i=1..4} A[i,M4(k +- i)] = 682775764735680 for k = 1, ..., 4 and M4(x) = y in {1, ..., 4} such that y == x (mod 4).
A pandiagonal magic square allows rotations (but not arbitrary cyclic permutations like, e.g., 1 -> 3 -> 4 -> 1) of columns or rows, as well as reflection on the 4 symmetry axes of the square (which also produce rotations of 90 degrees around the center of the square). Among all these variants of this square, there is none with elements coming earlier than (170693941183817, 170693941183933, ...), cf. PROGRAM for explicit verification.
The same 4 X 4 primes are given in increasing order in sequence A245721. But does not give more information than smallest term, the central term, or the magic constant itself (cf. A256234) which uniquely determines the sequence of primes (cf. PARI code) since they have to be consecutive and their sum is equal to 4 times the magic constant. The present sequence gives the full information about the magic square, and the given PARI code allows the production of all "equivalent" variants of the square.

Examples

			The magic square is
  [ 170693941183817 170693941183933 170693941183949 170693941183981 ]
  [ 170693941183979 170693941183951 170693941183847 170693941183903 ]
  [ 170693941183891 170693941183859 170693941184023 170693941183907 ]
  [ 170693941183993 170693941183937 170693941183861 170693941183889 ]
		

References

  • 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.

Crossrefs

Cf. A073519 and A320873, A073521, A073522 (3 X 3, 4 X 4 and 5 X 5 consecutive primes), A073523 and A320876 (6 X 6 consecutive primes, pandiagonal magic square).
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.

Programs

  • PARI
    /* 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.
Showing 1-4 of 4 results.