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-10 of 19 results. Next

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

A073521 The set of 16 consecutive primes with the property that they form a 4 X 4 magic square with the smallest magic constant (258).

Original entry on oeis.org

31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101
Offset: 1

Views

Author

N. J. A. Sloane, Aug 29 2002

Keywords

Examples

			The magic square is
[ 37 83 97 41 ]
[ 53 61 71 73 ]
[ 89 67 59 43 ]
[ 79 47 31 101 ]
		

References

  • Allan W. Johnson, Jr., Journal of Recreational Mathematics, vol. 14:2, 1981-82, pp. 152-153.
  • Clifford A. Pickover, The Zen of Magic Squares, Circles and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002.

Crossrefs

Programs

A256891 Smallest primes of 3 X 3 magic squares formed from consecutive primes.

Original entry on oeis.org

1480028129, 1850590057, 5196185947, 5601567187, 5757284497, 6048371029, 6151077269, 9517122259, 19052235847, 20477868319, 23813359613, 24026890159, 26748150199, 28519991387, 34821326119, 44420969909, 49285771679, 73827799009, 73974781889, 74220519319, 76483907837, 76560277009, 80143089599, 85892025227, 89132925737, 95515449037, 99977424653
Offset: 1

Views

Author

Arkadiusz Wesolowski, Apr 12 2015

Keywords

Comments

Let a = a(n) for some n and {a, b, c, d, e, f, g, h, i} be the set of consecutive primes. Then it is:
+---+---+---+ +---+---+---+
| d | c | h | | c | d | h |
+---+---+---+ +---+---+---+
| i | e | a | (type 1), or | i | e | a | (type 2). See Harvey D. Heinz.
+---+---+---+ +---+---+---+
| b | g | f | | b | f | g |
+---+---+---+ +---+---+---+
The type is determined by the sign of A343195.
For a given magic sum S, it is easy to calculate the unique set of n^2 consecutive primes that sum up to n*S (see PROGRAM MagicPrimes() in A073519), and in particular the smallest of these (cf. PROGRAM), listed here for n = 3, in A260673 for n = 4, in A272386 for n = 5, and in A272387 for n = 6. - M. F. Hasler, Oct 28 2018

References

  • Allan W. Johnson, Jr., Consecutive-Prime Magic Squares, Journal of Recreational Mathematics, vol. 15, 1982-83, pp. 17-18.
  • H. L. Nelson, A Consecutive Prime 3 x 3 Magic Square, Journal of Recreational Mathematics, vol. 20:3, 1988, p. 214.

Crossrefs

Programs

  • Magma
    /* Brute-force search */ lst:=[]; n:=3; while n lt 10^11 do a:=NextPrime(n); q:=a; j:=a-n; if j mod 6 eq 0 then b:=NextPrime(a); if j eq b-a then c:=NextPrime(b); d:=c-b; if d mod 6 eq 0 then e:=NextPrime(c); k:=e-c; if k eq j then f:=NextPrime(e); if k eq f-e then g:=NextPrime(f); if g-f eq d then h:=NextPrime(g); m:=h-g; if m eq k then i:=NextPrime(h); if h-g eq i-h then Append(~lst, n); end if; end if; end if; end if; end if; end if; end if; end if; n:=q; end while; lst;
    
  • PARI
    A256891(n)=MagicPrimes(A270305(n),3)[1] \\ See A073519 for MagicPrimes(). - M. F. Hasler, Oct 28 2018

Formula

a(n) = A151799(A151799(A151799(A151799(A166113(n))))). - Max Alekseyev, Nov 02 2015

Extensions

Extended by Max Alekseyev, Nov 02 2015

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

A320873 List of 3 X 3 magic squares made of consecutive primes, in order of increasing magic sum. Only the lexicographically smallest variant of equivalent squares (modulo D4 symmetries) is listed, as a row containing the 3 rows of the square.

Original entry on oeis.org

1480028141, 1480028189, 1480028183, 1480028213, 1480028171, 1480028129, 1480028159, 1480028153, 1480028201, 1850590069, 1850590117, 1850590111, 1850590141, 1850590099, 1850590057, 1850590087, 1850590081, 1850590129, 5196185959, 5196186007, 5196186001, 5196186031, 5196185989, 5196185947, 5196185977, 5196185971, 5196186019
Offset: 1

Views

Author

M. F. Hasler, Oct 22 2018

Keywords

Comments

The first row is the lexicographically first 3 X 3 magic square of consecutive primes with the smallest possible magic constant 4440084513 = A270305(1) = A073520(3).
The same 9 terms are also given in increasing order in sequence A073519. But this is equivalent of giving just the smallest of the terms (cf. A256891) or the central element (cf. A166113) or the magic constant itself (cf. A270305), which uniquely determines the sequence of primes since they have to be consecutive and their sum is equal to 3 times the magic constant.
In the case of 3 X 3 magic squares, however, the lexicographically smallest representative has its elements in a well-defined order, see comment in A320872. This allows the reconstruction of the square from the set of primes which can be computed from the central elements A166113 or magic constants A270305, cf. PROGRAM in A073519.

Examples

			The first row of 9 terms, (1480028141, 1480028189, 1480028183, 1480028213, 1480028171, 1480028129, 1480028159, 1480028153, 1480028201), corresponds to the following smallest 3 X 3 magic square of consecutive primes:
    [1480028141  1480028189  1480028183]
    [1480028213  1480028171  1480028129] .
    [1480028159  1480028153  1480028201]
The eleventh row yields the first example where the second term is smaller than the third one:
    [23813359643  23813359721  23813359727]
    [23813359781  23813359697  23813359613] .
    [23813359667  23813359673  23813359751]
		

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. A073520 (smallest magic sum for a n X n magic square made from consecutive primes).
Cf. A104157 (smallest of n^2 consecutive primes forming a magic square).
Cf. A166113 (center element of 3 X 3 magic squares of consecutive primes).
Cf. A256891 (smallest entry of 3 X 3 magic squares of consecutive primes) = A151799^4(A166113).
Cf. A270305 (magic sums of 3 X 3 magic squares of consecutive primes) = 3*A166113.

Programs

  • PARI
    A320873_row(n)=vecextract(n=MagicPrimes(3*A166113[n],3),[2,6+n=n[2]*2==n[1]+n[3],7-n,9,5,1,3+n,4-n,8]) \\ For MagicPrimes() see A073519 (the set of primes of the first row).
    /* the following allows the production of all 8 variants of a magic square that are equivalent modulo reflection on any of the 4 symmetry axes of the 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
    ALL(M,C(f,L)=concat(apply(f,L),L))=Set(C(REV,C(FLIP,[M,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.

Formula

a(9n-4) = A166113(n) = A270305(n)/3 for all n >= 1.

A073522 A set of 25 consecutive primes that form a 5 X 5 magic square with the (non-minimal) magic constant 1703.

Original entry on oeis.org

269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419
Offset: 1

Views

Author

N. J. A. Sloane, Aug 29 2002

Keywords

Comments

The magic constant here is not the smallest possible for a 5 X 5 magic square composed of consecutive primes, this would be A073520(5) = 313 corresponding to primes (13, 17, ..., 113). [Edited by M. F. Hasler, Oct 29 2018]

Examples

			The magic square is
[ 281 409 311 419 283 ]
[ 359 379 349 347 269 ]
[ 313 307 389 293 401 ]
[ 397 331 337 271 367 ]
[ 353 277 317 373 383 ]
		

References

  • Allan W. Johnson, Jr., Journal of Recreational Mathematics, vol. 14:2, 1981-82, pp. 152-153.
  • 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 (minimal 3 X 3 magic square of consecutive primes), A073520 (minimal magic sum for n X n square of consecutive primes), A073521 (consecutive primes of a 4 X 4 magic square), A073523 (consecutive primes of a pandiagonal 6 X 6 magic square).

Programs

Extensions

Edited by Max Alekseyev, Sep 24 2009

A270305 Magic sums of 3 X 3 magic squares composed of consecutive primes.

Original entry on oeis.org

4440084513, 5551770297, 15588557967, 16804701687, 17271853617, 18145113213, 18453231933, 28551366903, 57156707667, 61433605083, 71440079091, 72080670603, 80244450939, 85559974287, 104463978483, 133262909853, 147857315253, 221483397153, 221924345793, 222661558173, 229451723637, 229680831153, 240429269013, 257676075807, 267398777427, 286546347237, 299932274193
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 14 2016

Keywords

References

  • Allan W. Johnson, Jr., Consecutive-Prime Magic Squares, Journal of Recreational Mathematics, vol. 15, 1982-83, pp. 17-18.
  • H. L. Nelson, A Consecutive Prime 3 x 3 Magic Square, Journal of Recreational Mathematics, vol. 20:3, 1988, p. 214.

Crossrefs

Programs

  • PARI
    A270305(n,p=A256891[n],N=3)=sum(i=2,N^2,p=nextprime(p+1),p)/N \\ Illustrates the second formula. Uses a precomputed array A256891, unless the smallest prime is supplied as optional 2nd argument. See also the 4x4 and 5x5 analog, A173981 and A176571, where this is useful for finding possible sets of primes, cf. A260673 and A272386. - M. F. Hasler, Oct 28 2018

Formula

a(n) = 3*A166113(n).
a(n) = Sum_{k=0..8} prime(pi(A256891(n))+k)/3, where (prime)pi = A000720, prime = A000040. A similar formula is possible using the central prime A166113(n). - M. F. Hasler, Oct 28 2018
a(n) = 3*A256891(n) + 9*A343194(n) + 3*A343195(n). - A.H.M. Smeets, Apr 08 2021

A024351 Primes forming a 3 X 3 magic square with prime entries and minimal constant 177 = A164843(3).

Original entry on oeis.org

5, 17, 29, 47, 59, 71, 89, 101, 113
Offset: 1

Views

Author

Karl Schmerbauch (karl.j.schmerbauch(AT)boeing.com)

Keywords

Comments

The minimal 3 X 3 magic square made of consecutive primes has constant 4440084513 = A073520(3) = A270305(1), cf. A073519. - M. F. Hasler, Oct 22 2018
Sequence A073473 gives a variant using "primes including 1" (for historical reasons), to which also refers A073502. - M. F. Hasler, Oct 24 2018

Examples

			The square is [101 5 71 ; 29 59 89 ; 47 113 17].
The lexicographically smallest equivalent variant (modulo reflections on the symmetry axes of the square) is [17 89 71 ; 113 59 5 ; 47 29 101], cf. A320872. - _M. F. Hasler_, Oct 24 2018
		

Crossrefs

Cf. A320872 (3 X 3 magic squares of primes), A268790 (magic sums of these).

Programs

  • PARI
    A024351=select(p->setsearch(P,118-p),P=primes(30)[^5]) \\ 118 = 2*59, where 59 is the central prime; primes(30) = primes < 118. For the magic square itself, use A320872_row(1). -  M. F. Hasler, Oct 25 2018

Extensions

Offset corrected by Arkadiusz Wesolowski, Nov 26 2011

A104157 Smallest of n^2 consecutive primes that form an n X n magic square with the least magic constant, or 0 if no such magic square exists.

Original entry on oeis.org

2, 0, 1480028129, 31, 13, 7, 7, 79, 37, 23, 67, 89, 13, 89, 131, 31, 71, 47, 43, 73, 277, 353, 41, 67, 127, 223, 79, 13, 193, 5, 23, 43, 5, 67, 3, 19, 5, 59, 59, 653, 19, 19, 97, 409, 5, 383, 29, 137, 379, 349, 653, 1187, 47, 41, 37, 17, 619, 89, 283, 283, 43, 479, 191
Offset: 1

Views

Author

Robert G. Wilson v, Mar 09 2005

Keywords

Comments

The magic constants (= sums) are given in A073520. For a given sum, the corresponding list of primes (and thus also the smallest one) is easily calculated, cf. PARI code. - M. F. Hasler, Oct 29 2018

References

  • 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. A073519 or A320873 (the square for 3 X 3), A073520 (magic sums for 4 X 4 squares of consecutive primes), A073521 (consecutive primes of a 4 X 4 magic square), A073522 (consecutive primes of a (non minimal!) 5 X 5 magic square), A073523 (consecutive primes of a pandiagonal 6 X 6 magic square).

Programs

  • PARI
    A104157(n)=MagicPrimes(A073520[n],n)[1] \\ See A073519 for MagicPrimes(). This code uses a precomputed array A073520, but in practice one would rather compute that sequence as function of this one. - M. F. Hasler, Oct 29 2018

Formula

Conjecture: for n > 4, a(n) = prime(s) where s > 1 is the smallest integer such that (Sum_{i=s..s+n^2-1} prime(i))/n is an integer of the same parity as n. - Max Alekseyev, Jan 29 2010
a(n) = prime(i) such that Sum_{k=0..n^2-1} prime(i+k) = n*A073520(n). - M. F. Hasler, Oct 29 2018

Extensions

a(5)-a(6) corrected, a(7)-a(20) added by Max Alekseyev, Sep 24 2009
Definition edited by N. J. A. Sloane, Oct 03 2009
More terms from Max Alekseyev, Jan 29 2010

A260673 Smallest primes of 4 X 4 magic squares formed from consecutive primes.

Original entry on oeis.org

31, 37, 1229, 4931, 12553, 3259909, 3324329, 9291521, 24066643, 26025107, 46330021, 95979511, 99268649, 116923057, 170995151, 204041417, 213084871, 218568971, 229981399, 232850557, 254042641, 255432869, 256714219, 300222341, 375303157, 383432249, 421514827
Offset: 1

Views

Author

Arkadiusz Wesolowski, Nov 14 2015

Keywords

Examples

			        n = 3
|----|----|----|----|
|1229|1249|1321|1319|
|----|----|----|----|
|1301|1303|1231|1283|
|----|----|----|----|
|1297|1277|1307|1237|
|----|----|----|----|
|1291|1289|1259|1279|
|----|----|----|----|
.
        n = 4
|----|----|----|----|
|4943|4933|5011|5009|
|----|----|----|----|
|4999|4973|4967|4957|
|----|----|----|----|
|5003|4969|4987|4937|
|----|----|----|----|
|4951|5021|4931|4993|
|----|----|----|----|
		

References

  • Allan W. Johnson, Jr., Consecutive-Prime Magic Squares, Journal of Recreational Mathematics, vol. 15, 1982-83, pp. 17-18.

Crossrefs

Cf. A073521, A173981, A256891, A270864, A272386 (analog for n=5), A176571 (magic sums for n=5), A272387. Subsequence of A270865.

Programs

Extensions

Extended by Arkadiusz Wesolowski, Dec 13 2015
Showing 1-10 of 19 results. Next