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 25 results. Next

A152137 Apparently an erroneous version of A073520.

Original entry on oeis.org

2, 0, 4440084513, 258, 1703, 930
Offset: 1

Views

Author

Keywords

Comments

There is a slight possibility that the definition of this sequence is actually different from that of A073520.

A073519 The set of nine consecutive primes forming a 3 X 3 magic square with the smallest magic constant (4440084513).

Original entry on oeis.org

1480028129, 1480028141, 1480028153, 1480028159, 1480028171, 1480028183, 1480028189, 1480028201, 1480028213
Offset: 1

Views

Author

N. J. A. Sloane, Aug 29 2002

Keywords

Comments

The square is given (with the terms in correct order) in A320873. The (increasingly ordered) set of primes does not contain more information than the magic constant (= sum) S, since they have to be consecutive and sum up to 3*S. It is easy to construct the unique set of (consecutive) primes with this property, cf. PROGRAM. - M. F. Hasler, Oct 28 2018

Examples

			The magic square is
[ 1480028201 1480028129 1480028183 ]
[ 1480028153 1480028171 1480028189 ]
[ 1480028159 1480028213 1480028141 ]
		

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

Programs

  • PARI
    A073519=MagicPrimes(4440084513,3) \\ where: (also used in A073521, ...)
    MagicPrimes(S, n, 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, or a negative vector with an approximate solution if no exact solution exists. - M. F. Hasler, Oct 22 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

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

A173981 Magic constants of 4 X 4 magic squares which consist of consecutive primes.

Original entry on oeis.org

258, 276, 5118, 19896, 50478, 13039980, 13297678, 37166532, 96266778, 104100834, 185320518, 383918304, 397075158, 467692578, 683981178, 816166200, 852339780, 874276354, 919926054, 931402662, 1016171040, 1021731906, 1026857286, 1200889680, 1501212942, 1533729354, 1686059670
Offset: 1

Views

Author

Natalia Makarova, Mar 04 2010

Keywords

Comments

Necessary conditions for 16 primes from which a magic square of order 4 can be made, are:
1. Their sum S is a multiple of 4
2. Magic constant of possible square K=S/4 is even number.
This is equivalent to the requirement for S to be a multiple of 8.
For a fixed magic constant S, it is easy to obtain the set of n^2 consecutive primes that sum up to n*S, and in particular the smallest one: see the PROGRAM in A260673 which computes the smallest prime for any of the magic sums listed here (for n = 4), and A272386 for the n = 5 analog. The converse is trivial, cf. FORMULA and PROGRAM below. - M. F. Hasler, Oct 28 2018

Examples

			The smallest magic square of order 4 has the constant of 258. See A073520 and A073521.
The following array of 16 consecutive primes:
   37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103
also produces the magic square with the constant of K = 276:
    [ 41 37 97 101]
    [103 83 47  43]
    [ 71 67 79  59]
    [ 61 89 53  73]
But then not every array of 16 consecutive primes produces a magic square. The next magic square can be made from the array (1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321):
    [1229 1249 1321 1319]
    [1301 1303 1231 1283]   (K = 5118)
    [1297 1277 1307 1237]
    [1291 1289 1259 1279]
Two more examples:
    [4943 4933 5011 5009]                   [12553 12583 12689 12653]
    [4999 4973 4967 4957]   (K = 19896),    [12641 12647 12601 12589]   (K = 50478)
    [5003 4969 4987 4937]                   [12671 12611 12619 12577]
    [4951 5021 4931 4993]                   [12613 12637 12569 12659]
		

Crossrefs

Cf. A073520, A073521, A260673 (smallest terms in magic 4 X 4 squares of consecutive primes), A270865 (idem for semimagic squares). Subsequence of A270864 (analog for semimagic squares).
Cf. A270305 (analog for 3 X 3), A177434 (analog for 6 X 6).

Programs

  • PARI
    A173981(n, p=A260673[n], N=4)=sum(i=2, N^2, p=nextprime(p+1), p)/N \\ Illustration of the formula. - M. F. Hasler, Oct 28 2018

Formula

a(n) = Sum_{k=0..15} A000040(A000720(A260673(n))+k)/4. - M. F. Hasler, Oct 28 2018

Extensions

a(24)-a(25) from Arkadiusz Wesolowski, Dec 13 2015
Edited and added a(26)-a(27) (using A260673) by M. F. Hasler, Oct 30 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

A176571 Magic constants of 5 X 5 magic squares which consist of consecutive primes.

Original entry on oeis.org

313, 577, 703, 785, 865, 949, 1111, 1703, 2041, 2071, 2579, 2677, 2809, 3157, 3379, 3545, 4001, 4135, 4873, 5143, 5513, 5549, 5659, 5695, 5731, 5917, 6031, 6277, 6427, 6547, 7951, 8027, 8425, 8873, 9569, 9995, 10147, 10393, 10511, 10717, 11321, 11479, 12127
Offset: 1

Views

Author

Natalia Makarova, Apr 20 2010

Keywords

Comments

Let Z be the sum of 25 consecutive primes. The necessary condition to get a magic square of these primes is: z = 5(2m + 1), where m is natural number. The magic constant of expected square is S = 2m + 1.
The first array of consecutive primes, which satisfies this condition, can be obtained for m = 156. This array gives the smallest magic square with magic constant 313.
But not every array of 25 consecutive primes, satisfying the above condition, can be arranged into a magic square. Of the first 50 potential arrays we get 32 magic squares.
The suitable and non-suitable arrays are forming a certain pattern. There is an assumption that the sequence can be continued indefinitely.
Another problem is to find all the magic squares from the certain array. There is an implemented algorithm to solve it, but it takes quite much time.
Let K be the total number of magic squares composed of the numbers of the array for the rotations and reflections.
It was possible to obtain: for S = 949 K = 16140, for S = 1703 K = 5608.
For a fixed magic constant S, it is easy to obtain the set of n^2 consecutive primes that sum up to n*S, and in particular the smallest one: see the PROGRAM in A272386 which computes the smallest prime for any of the magic sums listed here (for n = 5), and A260673 for the n = 4 analog. - M. F. Hasler, Oct 28 2018

Examples

			Three examples of magic squares, which follow the one with the smallest constant.
Array: 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179
z = 2885, S = 577
   59  61 127 179 151
  107 131 167  83  89
  173 149  67  79 109
  101 139 103 163  71
  137  97 113  73 157
Array: 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
z = 3515, S = 703
   79  83 149 199 193
  107 173 179 131 113
  181 167 151 101 103
  197  89  97 163 157
  139 191 127 109 137
Array: 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
z = 3925, S = 785
   97 101 149 211 227
  199 179 163 107 137
  109 197 167 173 139
  223 127 113 191 131
  157 181 193 103 151
		

Crossrefs

Cf. A173981 (analog for 4 X 4 squares), A073520, A272386.

Programs

  • PARI
    A176571(n, p=A272386[n], N=5)=sum(i=2, N^2, p=nextprime(p+1), p)/N \\ Uses pre-computed array A272386, but can also be used to find these values: see there. - M. F. Hasler, Oct 30 2018

Extensions

a(33)-a(43) from Arkadiusz Wesolowski, Apr 28 2016

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
Showing 1-10 of 25 results. Next