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.
%I A173981 #31 Oct 12 2024 03:17:34 %S A173981 258,276,5118,19896,50478,13039980,13297678,37166532,96266778, %T A173981 104100834,185320518,383918304,397075158,467692578,683981178, %U A173981 816166200,852339780,874276354,919926054,931402662,1016171040,1021731906,1026857286,1200889680,1501212942,1533729354,1686059670 %N A173981 Magic constants of 4 X 4 magic squares which consist of consecutive primes. %C A173981 Necessary conditions for 16 primes from which a magic square of order 4 can be made, are: %C A173981 1. Their sum S is a multiple of 4 %C A173981 2. Magic constant of possible square K=S/4 is even number. %C A173981 This is equivalent to the requirement for S to be a multiple of 8. %C A173981 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 %H A173981 Zhao Hui Du, <a href="/A173981/b173981.txt">Table of n, a(n) for n = 1..443</a> %H A173981 Max Alekseyev, Natalia Makarova and others, <a href="http://dxdy.ru/post291297.html#291297">Discussion in the Magic square finding thread on scientific forum dxdy.ru</a> (in Russian), February-March 2010. %H A173981 Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_003.htm">Puzzle 3</a> %F A173981 a(n) = Sum_{k=0..15} A000040(A000720(A260673(n))+k)/4. - _M. F. Hasler_, Oct 28 2018 %e A173981 The smallest magic square of order 4 has the constant of 258. See A073520 and A073521. %e A173981 The following array of 16 consecutive primes: %e A173981 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103 %e A173981 also produces the magic square with the constant of K = 276: %e A173981 [ 41 37 97 101] %e A173981 [103 83 47 43] %e A173981 [ 71 67 79 59] %e A173981 [ 61 89 53 73] %e A173981 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): %e A173981 [1229 1249 1321 1319] %e A173981 [1301 1303 1231 1283] (K = 5118) %e A173981 [1297 1277 1307 1237] %e A173981 [1291 1289 1259 1279] %e A173981 Two more examples: %e A173981 [4943 4933 5011 5009] [12553 12583 12689 12653] %e A173981 [4999 4973 4967 4957] (K = 19896), [12641 12647 12601 12589] (K = 50478) %e A173981 [5003 4969 4987 4937] [12671 12611 12619 12577] %e A173981 [4951 5021 4931 4993] [12613 12637 12569 12659] %o A173981 (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 %Y A173981 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). %Y A173981 Cf. A270305 (analog for 3 X 3), A177434 (analog for 6 X 6). %K A173981 nonn %O A173981 1,1 %A A173981 _Natalia Makarova_, Mar 04 2010 %E A173981 a(24)-a(25) from _Arkadiusz Wesolowski_, Dec 13 2015 %E A173981 Edited and added a(26)-a(27) (using A260673) by _M. F. Hasler_, Oct 30 2018