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

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

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.

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

A166113 Center element of a 3 X 3 magic square composed of consecutive primes.

Original entry on oeis.org

1480028171, 1850590099, 5196185989, 5601567229, 5757284539, 6048371071, 6151077311, 9517122301, 19052235889, 20477868361, 23813359697, 24026890201, 26748150313, 28519991429, 34821326161, 44420969951, 49285771751, 73827799051, 73974781931, 74220519391, 76483907879, 76560277051, 80143089671, 85892025269, 89132925809, 95515449079, 99977424731
Offset: 1

Views

Author

Max Alekseyev, Oct 06 2009

Keywords

Crossrefs

Cf. A073519, A256891, A270305. Subsequence of A096710.

Formula

An element p of A096710 belongs to this sequence iff q+r=s+p and (q+s=p+t or r+s=p+t), where p,q,r,s,t are consecutive primes.
a(n) = A270305(n)/3. - Arkadiusz Wesolowski, Mar 14 2016

Extensions

Extended by Max Alekseyev, Oct 13 2009
a(19)-a(27) added by Natalia Makarova, Oct 30 2015

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

A265139 Smallest primes of 3 X 3 semimagic squares formed from consecutive primes.

Original entry on oeis.org

21821, 24091, 55201, 55787, 55807, 103969, 125597, 127703, 139291, 149921, 241771, 244493, 246889, 284659, 294731, 377537, 392233, 409879, 415937, 418849, 509797, 560447, 703679, 746191, 790927, 845347, 908491, 929239, 940829, 949951, 979189, 1012159
Offset: 1

Views

Author

Arkadiusz Wesolowski, Dec 02 2015

Keywords

Examples

			       n = 2
|-----|-----|-----|
|24091|24109|24137|
|-----|-----|-----|
|24113|24121|24103|
|-----|-----|-----|
|24133|24107|24097|
|-----|-----|-----|
.
       n = 3
|-----|-----|-----|
|55201|55219|55259|
|-----|-----|-----|
|55229|55243|55207|
|-----|-----|-----|
|55249|55217|55213|
|-----|-----|-----|
		

Crossrefs

Cf. A265614, A270865. Supersequence of A256891.

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

A268912 Magic sums of 3 X 3 semimagic squares composed of consecutive primes.

Original entry on oeis.org

65573, 72337, 165679, 167429, 167479, 311981, 376907, 383183, 417943, 449933, 725411, 733643, 740749, 854119, 884311, 1132717, 1176781, 1229731, 1247899, 1256659, 1529543, 1681439, 2111153, 2238667, 2372927, 2536175, 2725573, 2787865, 2822663, 2849927, 2937691
Offset: 1

Views

Author

Arkadiusz Wesolowski, Feb 15 2016

Keywords

Crossrefs

Cf. A265139, A265614, A256891. Supersequence of A270305.

A343194 a(n) is the parameter b in the three-parameter description of 3 X 3 magic squares of consecutive primes (see comment).

Original entry on oeis.org

12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 30, 12, 30, 12, 12, 12, 30, 12, 12, 30, 12, 12, 30, 12, 30, 12, 18, 12, 12, 30, 12, 30, 12, 18, 12, 12, 12, 12, 30, 12, 12, 60, 30, 12, 12, 12, 30, 30, 12, 6, 30, 30, 18, 18, 42, 12, 12, 42, 12, 12, 18, 12, 12, 12, 12, 30
Offset: 1

Views

Author

A.H.M. Smeets, Apr 07 2021

Keywords

Comments

Each 3 X 3 magic square of consecutive primes can be described by three parameters: p1, b and c, where p1 is the smallest prime in the magic square, b > 0 and c > -b; the magic square is then given by:
+----------+----------+----------+
| p1+5b+2c | p1 | p1+4b+c |
+----------+----------+----------+
| p1+2b | p1+3b+c | p1+4b+2c |
+----------+----------+----------+
| p1+2b+c | p1+6b+2c | p1+b |
+----------+----------+----------+
p1 is given in A256891 and c is given in A343195.
If c > 0, the magic square is of type 1; if -b < c < 0, the magic square is of type 2. If the consecutive primes are given by p1, p2, ..., p9 (in increasing order), the magic square types are given by:
Type 1 Type 2
+----+----+----+ +----+----+----+
| p8 | p1 | p6 | | p8 | p1 | p7 |
+----+----+----+ +----+----+----+
| p3 | p5 | p7 | | p4 | p5 | p6 |
+----+----+----+ +----+----+----+
| p4 | p9 | p2 | | p3 | p9 | p2 |
+----+----+----+ +----+----+----+

Crossrefs

Cf. A166113 (p5), A256891 (p1), A270305 (magic constant), A343195 (c).

Formula

a(n) = (A270305(n) - 3*A256891(n) - 3*A343195(n))/9.
a(n) = (A166113(n) - A256891(n) - A343195(n))/3.
Showing 1-10 of 11 results. Next