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-7 of 7 results.

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

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

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

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

Views

Author

Arkadiusz Wesolowski, Apr 28 2016

Keywords

Comments

A necessary condition for a prime being in this sequence is that the sum of this and the subsequent 24 primes divided by 5 must be an odd integer. - M. F. Hasler, Oct 30 2018

Examples

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

Crossrefs

Programs

  • PARI
    A272386(n)=MagicPrimes(A176571(n),5)[1] \\ See A073519 for MagicPrimes(). - M. F. Hasler, Oct 28 2018
    
  • PARI
    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

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

Views

Author

Arkadiusz Wesolowski, Apr 28 2016

Keywords

Crossrefs

Cf. A256891 (analog for 3 X 3), A260673 (4 X 4), A272386 (5 X 5).
Cf. A177434 (magic sums, 6 X 6 consecutive primes).

Programs

  • PARI
    A272387(n)=MagicPrimes(A177434(n),6)[1] \\ See A073519 for MagicPrimes(). - M. F. Hasler, Oct 28 2018
    
  • PARI
    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

A270865 Smallest primes of 4 X 4 semimagic squares formed from consecutive primes.

Original entry on oeis.org

5, 19, 29, 31, 37, 47, 53, 79, 397, 409, 599, 787, 1229, 1381, 1439, 1993, 2087, 2767, 4003, 4159, 4931, 5791, 5981, 8117, 9293, 9349, 9833, 10939, 10979, 11213, 12553, 12907, 14557, 16361, 18047, 21089, 21557, 21577, 25903, 26339, 28439, 33547, 56813, 57667
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 24 2016

Keywords

Examples

			      n = 1
|---|---|---|---|
| 5 | 7 | 53| 59|
|---|---|---|---|
| 29| 61| 23| 11|
|---|---|---|---|
| 43| 37| 31| 13|
|---|---|---|---|
| 47| 19| 17| 41|
|---|---|---|---|
.
      n = 2
|---|---|---|---|
| 19| 23| 79| 83|
|---|---|---|---|
| 53| 67| 37| 47|
|---|---|---|---|
| 61| 41| 59| 43|
|---|---|---|---|
| 71| 73| 29| 31|
|---|---|---|---|
		

Crossrefs

Cf. A265139, A270864. Supersequence of A260673.
Showing 1-7 of 7 results.