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.

Previous Showing 11-19 of 19 results.

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

A245721 The set of 16 consecutive primes forming a 4 X 4 pandiagonal magic square with the smallest magic constant, 682775764735680 = A256234(1).

Original entry on oeis.org

170693941183817, 170693941183847, 170693941183859, 170693941183861, 170693941183889, 170693941183891, 170693941183903, 170693941183907, 170693941183933, 170693941183937, 170693941183949, 170693941183951, 170693941183979, 170693941183981, 170693941183993, 170693941184023
Offset: 1

Views

Author

Max Alekseyev, Jul 30 2014

Keywords

Comments

Also, the set of 16 smallest consecutive primes forming a 4x4 Stanley antimagic square.
The set of primes is uniquely and straightforwardly determined by the magic sum, here A256234(1), cf. PROGRAM. See A320874 for the ordered list, i.e., the lexicographic smallest magic square made of these primes. - M. F. Hasler, Oct 23 2018

Examples

			A pandiagonal magic square formed by these primes:
  170693941183817 170693941183933 170693941183949 170693941183981
  170693941183979 170693941183951 170693941183847 170693941183903
  170693941183891 170693941183859 170693941184023 170693941183907
  170693941183993 170693941183937 170693941183861 170693941183889
A Stanley antimagic square formed by these primes:
  170693941183817 170693941183859 170693941183907 170693941183949
  170693941183847 170693941183889 170693941183937 170693941183979
  170693941183861 170693941183903 170693941183951 170693941183993
  170693941183891 170693941183933 170693941183981 170693941184023
		

Crossrefs

Cf. A320874 (the square made of the set of primes given here).
Cf. A073519 or A320873, A073521, A073522 (3 X 3, 4 X 4 and 5 X 5 consecutive primes), A073523 and A320876 (6 X 6 consecutive primes, pandiagonal magic square).
Cf. A210710: Minimal index of a Stanley antimagic square of order n consisting of distinct primes.
Cf. A073520: Smallest magic sum of a magic square made of n^2 consecutive primes.
Cf. A104157: Smallest of n X n consecutive primes forming a magic square.
Cf. A256234: Magic sums of 4 X 4 pandiagonal magic squares of consecutive primes.

Programs

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

A265614 A set of nine consecutive primes forming a 3 X 3 semimagic square with the smallest magic constant (65573).

Original entry on oeis.org

21821, 21839, 21841, 21851, 21859, 21863, 21871, 21881, 21893
Offset: 1

Views

Author

Arkadiusz Wesolowski, Dec 10 2015

Keywords

Examples

			The semimagic square is
|-----|-----|-----|
|21821|21859|21893|
|-----|-----|-----|
|21871|21863|21839|
|-----|-----|-----|
|21881|21851|21841|
|-----|-----|-----|
		

Crossrefs

Programs

  • Mathematica
    Prime@Range[2448, 2456]

A320876 Lexicographically first 6 X 6 pandiagonal magic square made of consecutive primes with the smallest magic constant (930).

Original entry on oeis.org

67, 139, 241, 73, 199, 211, 193, 233, 97, 167, 103, 137, 71, 113, 191, 131, 227, 197, 251, 181, 89, 229, 101, 79, 109, 157, 163, 151, 127, 223, 239, 107, 149, 179, 173, 83
Offset: 1

Views

Author

M. F. Hasler, Oct 22 2018

Keywords

Comments

The same 6 X 6 terms are given in increasing order in sequence A073523. But giving them in increasing order does not contain more information as the smallest of them or magic constant (= sum) itself, which uniquely determines the sequence of primes since they have to be consecutive and their sum is equal to 6 times the magic constant. The present sequence gives the full information about the magic square.
A pandiagonal magic square allows rotations (rather than arbitrary cyclic permutations) of columns or rows, as well as reflection on the 4 symmetry axes of the square. Considering all these variants of this square, there is none with elements coming earlier than (67, 139, ...)
There exist non-pandiagonal 6 X 6 magic squares composed of consecutive primes with smaller magic constant, the smallest being A073520(6) = 484.
Pandiagonal means that not only the 2 main diagonals, but all other 10 diagonals also have the same sum, Sum_{i=1..6} A[i,M6(k +/- i)] = 930 for k = 1, ..., 6 and M6(x) = y in {1, ..., 6} such that y == x (mod 6).

Examples

			The magic square is
  [ 67 139 241  73 199 211]
  [193 233  97 167 103 137]
  [ 71 113 191 131 227 197]
  [251 181  89 229 101  79]
  [109 157 163 151 127 223]
  [239 107 149 179 173  83]
		

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

Programs

  • PARI
    /* the following transformation operators for matrices, together with transposition, allow the production of all variants of a (pandiagonal) magic square */
    REV(M)=matconcat(Vecrev(M)) \\ reverse the order of columns of M
    FLIP(M)=matconcat(Colrev(M)) \\ reverse the order of row of M
    ROT(M,k=1)=matconcat([M[,k+1..#M],M[,1..k]]) \\ rotate left by k (default: 1) columns
    ALL(M)=Set(concat(apply(M->vector(#M,k,ROT(M,k)),[M,M~,REV(M),REV(M~),FLIP(M),FLIP(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.
    MagicPrimes(S=930,n=6,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 (= A073523 for default values), or a negative vector of "best approximation" if there is no exact solution.

A217568 Rows of the 8 magic squares of order 3 and magic sum 15, lexicographically sorted.

Original entry on oeis.org

2, 7, 6, 9, 5, 1, 4, 3, 8, 2, 9, 4, 7, 5, 3, 6, 1, 8, 4, 3, 8, 9, 5, 1, 2, 7, 6, 4, 9, 2, 3, 5, 7, 8, 1, 6, 6, 1, 8, 7, 5, 3, 2, 9, 4, 6, 7, 2, 1, 5, 9, 8, 3, 4, 8, 1, 6, 3, 5, 7, 4, 9, 2, 8, 3, 4, 1, 5, 9, 6, 7, 2
Offset: 1

Views

Author

Jean-François Alcover, Oct 08 2012

Keywords

Comments

See A320871, A320872 and A320873 for the list of all 3 X 3 magic squares of distinct integers, primes, resp. consecutive primes. In all these, only the lexicographically smallest of the eight "equivalent" squares are listed. Note that the terms are not always in the order that corresponds to the terms of this sequence. For example, in row 3 of A320871 and row 11 of A320873, the second term is smaller than the third term. However, when this is not the case, then row n of the present sequence is the list of indices which gives the n-th variant of the square from the (ordered) set of 9 elements: e.g., (2, 7, 6, ...) means that the 2nd, 7th and 6th of the set of 9 numbers yield the first row of the square. For example, A320873(n) = A073519(a(n)), 1 <= n <= 9. - M. F. Hasler, Nov 04 2018

Examples

			The first such magic square is
2, 7, 6
9, 5, 1
4, 3, 8
From _M. F. Hasler_, Sep 23 2018: (Start)
The complete table reads:
[2, 7, 6, 9, 5, 1, 4, 3, 8]
[2, 9, 4, 7, 5, 3, 6, 1, 8]
[4, 3, 8, 9, 5, 1, 2, 7, 6]
[4, 9, 2, 3, 5, 7, 8, 1, 6]
[6, 1, 8, 7, 5, 3, 2, 9, 4]
[6, 7, 2, 1, 5, 9, 8, 3, 4]
[8, 1, 6, 3, 5, 7, 4, 9, 2]
[8, 3, 4, 1, 5, 9, 6, 7, 2] (End)
		

Crossrefs

Cf. A320871, A320872, A320873: inequivalent 3 X 3 magic squares of distinct integers, primes, consecutive primes.

Programs

  • Mathematica
    squares = {}; a=5; Do[m = {{a + b, a - b - c, a + c}, {a - b + c, a, a + b - c}, {a - c, a + b + c, a - b}}; If[ Unequal @@ Flatten[m] && And @@ (1 <= #1 <= 9 & ) /@ Flatten[m], AppendTo[ squares, m]], {b, -(a - 1), a - 1}, {c, -(a - 1), a - 1}]; Sort[ squares, FromDigits[ Flatten[#1] ] < FromDigits[ Flatten[#2] ] & ] // Flatten
  • PARI
    A217568=select(S->Set(S)==[1..9],concat(vector(9,a,vector(9,b,[a,b,15-a-b,20-2*a-b,5,2*a+b-10,a+b-5,10-b,10-a])))) \\ Could use that a = 2k, k = 1..4, and b is odd, within max(1,7-a)..min(9,13-a). - M. F. Hasler, Sep 23 2018

A320874 Lexicographically first 4 X 4 pandiagonal magic square made of consecutive primes.

Original entry on oeis.org

170693941183817, 170693941183933, 170693941183949, 170693941183981, 170693941183979, 170693941183951, 170693941183847, 170693941183903, 170693941183891, 170693941183859, 170693941184023, 170693941183907, 170693941183993, 170693941183937, 170693941183861, 170693941183889
Offset: 1

Views

Author

M. F. Hasler, Oct 22 2018

Keywords

Comments

This is also the 4 X 4 pandiagonal magic square made of consecutive primes which has the smallest possible magic constant (= sum), 682775764735680 = A256234(1). (In the present case there is no other non-equivalent pandiagonal 4 X 4 magic square having the same magic sum, but this could be possible as for rows 7 and 8 of A320872.)
There exist many non-pandiagonal 4 X 4 magic squares composed of consecutive primes with much smaller magic constant, the smallest being A073520(4) = 258.
Pandiagonal means that not only the 2 main diagonals, but also the 6 other "broken" diagonals all have the same sum, Sum_{i=1..4} A[i,M4(k +- i)] = 682775764735680 for k = 1, ..., 4 and M4(x) = y in {1, ..., 4} such that y == x (mod 4).
A pandiagonal magic square allows rotations (but not arbitrary cyclic permutations like, e.g., 1 -> 3 -> 4 -> 1) of columns or rows, as well as reflection on the 4 symmetry axes of the square (which also produce rotations of 90 degrees around the center of the square). Among all these variants of this square, there is none with elements coming earlier than (170693941183817, 170693941183933, ...), cf. PROGRAM for explicit verification.
The same 4 X 4 primes are given in increasing order in sequence A245721. But does not give more information than smallest term, the central term, or the magic constant itself (cf. A256234) which uniquely determines the sequence of primes (cf. PARI code) since they have to be consecutive and their sum is equal to 4 times the magic constant. The present sequence gives the full information about the magic square, and the given PARI code allows the production of all "equivalent" variants of the square.

Examples

			The magic square is
  [ 170693941183817 170693941183933 170693941183949 170693941183981 ]
  [ 170693941183979 170693941183951 170693941183847 170693941183903 ]
  [ 170693941183891 170693941183859 170693941184023 170693941183907 ]
  [ 170693941183993 170693941183937 170693941183861 170693941183889 ]
		

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. A073519 and A320873, A073521, A073522 (3 X 3, 4 X 4 and 5 X 5 consecutive primes), A073523 and A320876 (6 X 6 consecutive primes, pandiagonal magic square).
Cf. A210710: Minimal index of a Stanley antimagic square of order n consisting of distinct primes.
Cf. A073520: Smallest magic sum for an n^2 magic square made of consecutive primes.
Cf. A104157: Smallest of n X n consecutive primes forming a magic square.
Cf. A256234: Magic sums of 4 X 4 pandiagonal magic squares of consecutive primes.

Programs

  • PARI
    /* the following transformation operators for matrices, together with transposition, allow the production of all (24 for n=4) variants of a (pandiagonal) magic 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
    ROT(M,k=1)=matconcat([M[,k+1..#M],M[,1..k]]) \\ rotate left by k (default: 1) columns
    ALL(M)=Set(concat(apply(M->vector(#M,k,ROT(M,k)),[M,M~,REV(M),REV(M~),FLIP(M),FLIP(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.
    \\ The set of primes is A245721=MagicPrimes(682775764735680,4), cf. A073519.

A174092 Primes p = -83 + n * 30 (n = 0, 1, ..., 8) forming "optimal" 3 x 3 Magic Prime Square.

Original entry on oeis.org

-83, -53, -23, 7, 37, 67, 97, 127, 157
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Mar 07 2010

Keywords

Comments

1st row: -53 157 7
2nd row: 97 37 -23
3rd row: 67 -83 127
Magic 3 x 3 square with minimal magic constant M = 3 * 37 = 111.
Elements are in arithmetic 1st-order progression, negative p are primes.
This magic prime square (MPS) from the author dates from 2008.
Note that Dudeney's MPS from 1917 has the nonprime element 1:
67 1 43
13 37 61
31 73 7
Madachy/Ondrejka gave 1979 MPS with M = 3 * 59 = 177 > 111:
17 89 71
113 59 5
47 29 101

References

  • E. Dudeney: Amusements in Mathematics, Problem 408, New York: Dover, 1970.
  • J. S. Madachy: Magic and Antimagic Squares, Madachy's Mathematical Recreations, New York, pp. 85-113, New York: Dover, 1979.
  • M. Miller: Geloeste und ungeloeste mathematische Probleme, Leipzig, 1982.

Crossrefs

Previous Showing 11-19 of 19 results.