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

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

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

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