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

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

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

A177434 The magic constants of 6 X 6 magic squares composed of consecutive primes.

Original entry on oeis.org

484, 744, 806, 868, 930, 1390, 1460, 1494, 1634, 1704, 1740, 1848, 1992, 2100, 2172, 2316, 2390, 2540, 3116, 3192, 3694, 3734, 3774, 4486, 4946, 4988, 5736, 6104, 6148, 6526, 6568, 6610, 6776, 6820, 6950, 7036, 7078, 7120, 7984, 8118, 8162, 8828, 9318
Offset: 1

Views

Author

Natalia Makarova, May 08 2010

Keywords

Comments

Let Z be a sum of 36 consecutive primes. A necessary condition to get a 6 X 6 magic square using these primes is that Z=6S, where S is even. The smallest magic constant of a 6 X 6 magic square of consecutive primes is 484 (cf. A073520).
Each of the first 100 possible arrays of 36 consecutive primes which satisfy the necessary condition produces a magic square.
A program written by Stefano Tognon was used.

Examples

			S = 744
   [139 113 151 131  83 127]
   [223 149  89  47 157  79]
   [173 103 181 167  59  61]
   [ 67 137  53  97 211 179]
   [101 199  73 109  71 191]
   [ 41  43 197 193 163 107]
S = 806
   [131  53 107 157 191 167]
   [ 89 229 179  97 109 103]
   [ 83 211  71 139  79 223]
   [113 101 137 181 227  47]
   [197  61 163  59 127 199]
   [193 151 149 173  73  67]
S = 868
   [191 137  79 193 197  71]
   [ 67 157  73 229 239 103]
   [179 173 167  97 101 151]
   [211 181 223  61 109  83]
   [113 131 199 139  59 227]
   [107  89 127 149 163 233]
Magic square with S=930 can be pan-diagonal (cf. A073523).
Example of a non-pan-diagonal square:
S = 930
   [167  71 151 199 131 211]
   [ 89 241 181  73 113 233]
   [ 83 227 127 197 229  67]
   [239 137 139 103 163 149]
   [179  97 223 251 101  79]
   [173 157 109 107 193 191]
		

Crossrefs

Cf. A173981 (analog for 4 X 4), A176571 (analog for 5 X 5), A073523 (36 consecutive primes of a pandiagonal magic square), A073520 (smallest magic sum for n X n), A259733 (most-perfect 8 X 8), A272387 (smallest element of 6 X 6 magic squares of consecutive primes).

Programs

Formula

a(n) = Sum_{k=0..35} A000040(A000720(A272387(n))+k)/6. - M. F. Hasler, Oct 28 2018

Extensions

Edited by M. F. Hasler, Oct 28 2018

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

A188536 Potential magic constants of 7 X 7 magic squares composed of consecutive primes.

Original entry on oeis.org

797, 1077, 1651, 1691, 1895, 2059, 2817, 3263, 4193, 4615, 4803, 4987, 5453, 5501, 5745, 5993, 6427, 6761, 7149, 7547, 7797, 7943, 8489, 8705, 9439, 9747, 9899, 10201, 10347, 10661, 11059, 12367, 12591, 12815, 13095, 13861, 14359, 14693
Offset: 1

Views

Author

Natalia Makarova, Apr 03 2011

Keywords

Comments

For a 7 X 7 magic square composed of 49 consecutive primes, it is necessary that the sum of these primes is a multiple of 7.
This sequence consists of integers equal to the sum of 49 consecutive primes divided by 7. It is not known whether each such set of consecutive primes can be arranged into a 7 X 7 magic square but it looks plausible.

Examples

			a(2) = 1077:
  [ 281  167  101   43  191   37  257
    173   79  227   71  179  211  137
    157  109  139  277   47  251   97
    199  151   41   89  223  193  181
     83  197  239  229  107  163   59
     53  103  263  127  269  149  113
    131  271   67  241   61   73  233 ]
.
a(3) = 1651:
  [ 239  349  359  113  127  271  193
    109  277  311  293  191  307  163
    149  223  281  379  283  197  139
    199  233  251  211  373  157  227
    367  331  179  137  151  173  313
    241  131  103  337  257  229  353
    347  107  167  181  269  317  263 ]
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember;
           `if`(n=1, add(ithprime(i), i=1..49),
                     ithprime(n+48) -ithprime(n-1) +s(n-1))
        end:
    a:= proc(n) option remember; local k, m; a(n-1);
           for k from 1+b(n-1) while irem(s(k),7,'m')<>0 do od;
           b(n):= k; m
        end:
    a(0):=0: b(0):=0:
    seq(a(n), n=1..50);  # Alois P. Heinz, Apr 07 2011
  • Mathematica
    Total[#]/7&/@Select[Partition[Prime[Range[400]],49,1], Divisible[ Total[ #],7]&]  (* Harvey P. Dale, Jan 03 2012 *)

Extensions

Edited by Max Alekseyev, Jun 18 2011

A189188 Potential magic constants of 8 X 8 magic squares composed of consecutive primes.

Original entry on oeis.org

2016, 2244, 2336, 2570, 2762, 4106, 4362, 4464, 4566, 4670, 4776, 4934, 5952, 6870, 7036, 7146, 7588, 7644, 7700, 8824, 9756, 9930, 9988, 10394, 10454, 10514, 10690, 10868, 10928, 11560, 12620, 12682, 14986, 15424, 15808, 16000, 16510, 18668, 20434
Offset: 1

Views

Author

Natalia Makarova, Apr 18 2011

Keywords

Comments

For an 8 X 8 magic square composed of 64 consecutive primes, it is necessary that the sum of these primes is a multiple of 16.
This sequence consists of even integers equal to the sum of 64 consecutive primes divided by 8. It is not known whether each such set of consecutive primes can be arranged into an 8 X 8 magic square but it looks plausible.
From A.H.M. Smeets, Jan 20 2021: (Start)
Except from the condition that a magic constant exists, it must be an even magic constant due to the fact that the order is even, which explains why the sum of primes must be divisable by 16.
The number of possible combinations of 8 primes out of the 64 consecutive primes added results in the magic constant is such that in almost all cases such a magic square existsts. However, as n increases, the diversity in prime gaps between the 64 consecutive primes increases, and thus the probability that a potential magic constant will lead to a magic square configuration will decrease. The challenge here seems to be to find a potential magic constant which has no magic square configuration. (End)

Examples

			a(1) = 2016
  [ 79 137 197 199 277 347 349 431
   127 193 131 419 337 421 107 281
   103 379 283 389 293 227 179 163
   397 251  83 271 269 157 439 149
   409 211 383 191 181 101 401 139
   307 239 317 167  89 367  97 433
   353 233 359 151 257 223 331 109
   241 373 263 229 313 173 113 311 ]
.
a(12) = 4934
  [ 823 619 461 457 631 587 599 757
    443 563 647 509 733 761 787 491
    503 809 419 701 661 797 487 557
    683 499 743 677 449 607 617 659
    439 727 571 577 719 821 601 479
    811 641 593 523 421 467 709 769
    691 433 673 751 773 431 613 569
    541 643 827 739 547 463 521 653 ]
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember;
           `if` (n=1, add (ithprime(i), i=1..64),
                      ithprime(n+63) -ithprime(n-1) +s(n-1))
        end:
    a:= proc(n) option remember; local k, m; a(n-1);
           for k from 1+b(n-1) while irem(s(k), 16, 'm')<>0 do od;
           b(n):= k; 2*m
        end:
    a(0):=0: b(0):=0:
    seq(a(n), n=1..50);

Extensions

Edited by Max Alekseyev, Jun 18 2011

A191679 Potential magic constants of 9 X 9 magic squares composed of consecutive primes.

Original entry on oeis.org

2211, 2261, 2311, 2463, 2725, 4257, 6125, 6611, 7821, 9841, 9973, 10303, 10499, 10631, 10953, 11987, 12115, 12179, 12243, 12309, 12375, 12637, 12837, 13497, 13695, 14169, 15063, 15395, 16207, 16483, 16821, 17605, 17891, 19017, 20345, 20487, 21135, 22539, 22811, 23219, 23985
Offset: 1

Views

Author

Natalia Makarova, Jun 11 2011

Keywords

Comments

For a 9 X 9 magic square composed of 81 consecutive primes, it is necessary that the sum of these primes is a multiple of 9.
This sequence consists of integers equal the sum of 81 consecutive primes divides by 9. It is not known whether each such set of consecutive primes can be arranged into 9 X 9 magic square but it looks plausible.

Examples

			a(1)=2211 for a square containing prime(12)..prime(92):
  [37 127 163 179 229 233 379 421 443
   41 431 463 457  59 139 433 109  79
  409 311 389  71 307 347 281  53  43
  373 137 181 251 401 239 317  89 223
  173 419 101 103 113 353 313 277 359
   97 383 397 479  47 197 107 263 241
  349 131 193 149 367 199  73 467 283
  439  61 257 191 227 167 151 449 269
  293 211  67 331 461 337 157  83 271]
a(2)=2261 for a square containing prime(13)..prime(93):
  [41  379  281  467  349  257  229  199   59
  313  223  127  337  131  101  479  107  443
  409   71  331   79  137  263  347  271  353
  211  307  487  149  251  293  181  113  269
  191  419  109  439  173  233  103  397  197
   97  283  193  317  433  457  241  157   83
  461  139  239  359  373  179   67  401   43
   89  277   73   53  367  167  463  389  383
  449  163  421   61   47  311  151  227  431]
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember;
           `if` (n=1, add (ithprime(i), i=1..81),
                      ithprime(n+80) -ithprime(n-1) +s(n-1))
        end:
    a:= proc(n) option remember; local k, m;
           a(n-1);
           for k from 1+b(n-1) while irem (s(k), 9, 'm')<>0 do od;
           b(n):= k; m
        end:
    a(0):=0: b(0):=0:
    seq (a(n), n=1..50);
  • Mathematica
    Total[#]/9&/@Select[Partition[Prime[Range[500]],81,1],Divisible[ Total[ #],9]&] (* Harvey P. Dale, Jan 08 2014 *)

Extensions

Edited by Max Alekseyev, Jun 18 2011

A192087 Potential magic constants of a 10 X 10 magic square composed of consecutive primes.

Original entry on oeis.org

2862, 3092, 3500, 4222, 4780, 5608, 7124, 10126, 10198, 11212, 11426, 12140, 12212, 12284, 12356, 12428, 12714, 12854, 12924, 15270, 16252, 16476, 18594, 18672, 18750, 18828, 19214, 20764, 21150, 23752, 24214, 24598, 24828, 27180, 27342, 27424, 27916, 28666, 29406, 29568
Offset: 1

Views

Author

Natalia Makarova, Jun 23 2011

Keywords

Comments

For a 10 X 10 magic square composed of 100 consecutive primes, the sum of these primes must be a multiple of 20.
This sequence consists of even integers equal the sum of 100 consecutive primes divided by 10. It is not known whether each such set of consecutive primes can be arranged into a 10 X 10 magic square but it looks plausible.
Actual magic squares were constructed for all listed magic constants <= 11212.

Examples

			a(1)=2862 for a square containing prime(9)..prime(108):
  [23  179  409  373  263  137  461  457  523   37
  193  353  443  199  317  109  337  397  131  383
   71   73  389  251  593  167  439  449  233  197
  571  293  101  229   29  557  271   31  379  401
  127  419  283  241  269  239  547   89  181  467
  491  433  223  113   41  577   43  311  563   67
  281   97  163  587  191  313  149  509  421  151
  307  499  227  431  103   83   59  479  211  463
  277  359  257  331  569  541   53   79   47  349
  521  157  367  107  487  139  503   61  173  347]
.
a(10)=11212
  [769   863  1171   967   859  1381  1237  1459  1289  1217
  1163   953   797  1297  1049  1021  1303   977  1423  1229
   809  1277  1153   937  1151  1409  1291   839  1249  1097
  1429  1231  1193  1451  1061   829   821  1361   823  1013
  1453   997   947  1091  1321   887  1283   941   811  1481
  1069  1201  1427  1129   907   919  1373  1039  1117  1031
  1009  1123  1301  1093  1367  1483   911  1051  1087   787
   991  1109  1279   877  1223   929  1187  1433  1327   857
  1213  1439  1063   971  1447   883   773  1259   983  1181
  1307  1019   881  1399   827  1471  1033   853  1103  1319]
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember;
           `if` (n=1, add (ithprime(i), i=1..100),
                      ithprime(n+99) -ithprime(n-1) +s(n-1))
        end:
    a:= proc(n) option remember; local k, m;
           a(n-1);
           for k from 1+b(n-1) while irem (s(k), 20, 'm')<>0 do od;
           b(n):= k; m
        end:
    a(0):=0: b(0):=0:
    seq (2*a(n), n=1..50);
Showing 1-8 of 8 results.