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.

A024351 Primes forming a 3 X 3 magic square with prime entries and minimal constant 177 = A164843(3).

Original entry on oeis.org

5, 17, 29, 47, 59, 71, 89, 101, 113
Offset: 1

Views

Author

Karl Schmerbauch (karl.j.schmerbauch(AT)boeing.com)

Keywords

Comments

The minimal 3 X 3 magic square made of consecutive primes has constant 4440084513 = A073520(3) = A270305(1), cf. A073519. - M. F. Hasler, Oct 22 2018
Sequence A073473 gives a variant using "primes including 1" (for historical reasons), to which also refers A073502. - M. F. Hasler, Oct 24 2018

Examples

			The square is [101 5 71 ; 29 59 89 ; 47 113 17].
The lexicographically smallest equivalent variant (modulo reflections on the symmetry axes of the square) is [17 89 71 ; 113 59 5 ; 47 29 101], cf. A320872. - _M. F. Hasler_, Oct 24 2018
		

Crossrefs

Cf. A320872 (3 X 3 magic squares of primes), A268790 (magic sums of these).

Programs

  • PARI
    A024351=select(p->setsearch(P,118-p),P=primes(30)[^5]) \\ 118 = 2*59, where 59 is the central prime; primes(30) = primes < 118. For the magic square itself, use A320872_row(1). -  M. F. Hasler, Oct 25 2018

Extensions

Offset corrected by Arkadiusz Wesolowski, Nov 26 2011

A320872 For all possible 3 X 3 magic squares made of primes, in order of increasing magic sum, list the lexicographically smallest representative of each equivalence class (modulo symmetries of the square), as a row of the 9 elements (3 rows of 3 elements each).

Original entry on oeis.org

17, 89, 71, 113, 59, 5, 47, 29, 101, 41, 89, 83, 113, 71, 29, 59, 53, 101, 37, 79, 103, 139, 73, 7, 43, 67, 109, 29, 131, 107, 167, 89, 11, 71, 47, 149, 43, 127, 139, 199, 103, 7, 67, 79, 163, 37, 151, 139, 211, 109, 7, 79, 67, 181, 43, 181, 157, 241, 127, 13, 97, 73, 211
Offset: 1

Views

Author

M. F. Hasler, Oct 25 2018

Keywords

Comments

Magic squares of size 3 X 3 must be of the form
[ c-a-b c+b c+a ]
[ c+2a+b c c-2a-b ]
[ c-a c-b c+a+b ]
or any of the eight variants obtained by reflection(s) on any of the 4 symmetry axes of the square (horizontal, vertical and diagonals), which also produce the rotations by 90°, 180° and 270°. Of these eight variants the displayed one with a > b > 0 is the smallest one, with b > a > 0 the next larger one. (Strict inequalities since we require all elements to be distinct.) In this sequence we also restrict all entries to be primes, which may exclude one of the two possibilities (a > b or b > a).
The central elements, a(5 + 9k), k >= 0, or column 5 = T(n,5) if the sequence is seen as a table with rows of length 9, are (59, 71, 73, 89, 103, 109, 127, 127, 131, 137, 139, 149, 151, 157, 167, 167, 173, 179, 191, 191, ...). (Sequence not in OEIS.) If the primes are multiplied by three and duplicates are removed, one gets A268790 = list of magic sums of 3 X 3 magic squares of primes.

Examples

			The first four rows,
  17, 89, 71, 113, 59, 5, 47, 29, 101,
  41, 89, 83, 113, 71, 29, 59, 53, 101,
  37, 79, 103, 139, 73, 7, 43, 67, 109,
  29, 131, 107, 167, 89, 11, 71, 47, 149, (...)
correspond to the following magic squares:
   [ 17, 89, 71 ]    [ 41, 89,  83]    [ 37, 79, 103]    [ 29, 131, 107]
   [113, 59,  5 ]    [113, 71,  29]    [139, 73,  7 ]    [167,  89,  11]
   [ 47, 29, 101]    [ 59, 53, 101]    [ 43, 67, 109]    [ 71,  47, 149]
The seventh and eighth row are two inequivalent magic squares for the same magic sum 3*127:
   [ 43, 181, 157]         [ 73, 151, 157]
   [241, 127,  13]   and   [211, 127,  43] .  (The pair (13, 241) is replaced
   [ 97,  73, 211]         [ 97, 103, 181]     by (103, 151).)
		

Crossrefs

Cf. A320871: list of all inequivalent 3 X 3 magic squares (not only primes).
Cf. A320873: the first row consisting of a set of consecutive primes.
Cf. A268790: list of magic sums (= 3*(central term) = (row sum)/3), without duplicates.

Programs

  • PARI
    A320872_row(N=10,show=1,c=3)={forprime(c=c,, forstep(d=c-3,2,-2, isprime(c-d)&& isprime(c+d)&& forstep(b=max(2*d+3-c,2),d-2,2, d!=2*b&& isprime(c-2*d+b)&& isprime(c-b)&& isprime(c-d+b)&& isprime(c+d-b)&& isprime(c+2*d-b)&& isprime(c+b)&& (S=[c-d,c+b,c+d-b;c+2*d-b,c,c-2*d+b;c-d+b,c-b,c+d])&& !(show&&print(S))&& !N--&& return(S))))} \\ The 3rd (optional) argument allows computation of the list starting with the first row having a central element >= c or equivalently a magic sum >= 3c. The multiple isprime() can all be avoided using simply vecmin(apply(isprime,S=[...])), but this is significantly slower, which matters if used as proposed in A268790.

A271578 Magic sums of 4 X 4 magic squares composed of primes.

Original entry on oeis.org

120, 126, 132, 136, 138, 140, 142, 144, 146, 148, 150, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234
Offset: 1

Views

Author

Arkadiusz Wesolowski, Apr 10 2016

Keywords

Comments

I conjecture that every even number greater than 152 belongs to this sequence.

Examples

			Examples of 4 X 4 magic squares composed of primes.
.
|---|---|---|---|
| 3 | 7 | 43| 67|
|---|---|---|---|
| 31| 61| 17| 11|
|---|---|---|---|
| 73| 23| 19| 5 |
|---|---|---|---|
| 13| 29| 41| 37|
|---|---|---|---|
The magic constant is 120 = a(1).
.
|---|---|---|---|
| 3 | 7 | 43| 73|
|---|---|---|---|
| 31| 67| 17| 11|
|---|---|---|---|
| 79| 23| 19| 5 |
|---|---|---|---|
| 13| 29| 47| 37|
|---|---|---|---|
The magic constant is 126 = a(2).
		

Crossrefs

Formula

If conjecture is true, a(n) = A005843(n+65) for n >= 12.

A320871 List of all inequivalent 3 X 3 magic squares made of distinct positive integers, sorted by increasing sum. For each equivalence class modulo symmetries of the square, the lexicographically smallest representative is shown.

Original entry on oeis.org

2, 7, 6, 9, 5, 1, 4, 3, 8, 2, 9, 7, 11, 6, 1, 5, 3, 10, 3, 7, 8, 11, 6, 1, 4, 5, 9, 3, 8, 7, 10, 6, 2, 5, 4, 9, 2, 11, 8, 13, 7, 1, 6, 3, 12, 3, 10, 8, 12, 7, 2, 6, 4, 11, 4, 8, 9, 12, 7, 2, 5, 6, 10, 4, 9, 8, 11, 7, 3, 6, 5, 10, 2, 13, 9, 15, 8, 1, 7, 3, 14, 3, 11, 10, 15, 8, 1, 6, 5, 13
Offset: 1

Views

Author

M. F. Hasler, Oct 28 2018

Keywords

Comments

"Symmetries of the square" means the symmetry group D4 consisting of reflections on any of the 4 symmetry axes of the square (horizontal H, vertical V, 2 diagonals D & A), which also generates the rotations around the center by multiples of 90°, R1, R2, R3 (and R0 = id): e.g., H o D = R1, where D means to transpose the 3 X 3 matrix, H means reversal of the rows, etc.
The 8 ("equivalent") variants of the first square are listed in A217568.

Examples

			The first five inequivalent magic squares (with magic sums 15, 18, 18, 18, 21) are
   [2 7 6]    [ 2 9  7]    [ 3 7 8]    [ 3 8 7]    [ 2 11  8]
   [9 5 1]    [11 6  1]    [11 6 1]    [10 6 2]    [13  7  1]
   [4 3 8]    [ 5 3 10]    [ 4 5 9]    [ 5 4 9]    [ 6  3 12]
They are listed as rows of the 9 elements of each square, so the first row is:
  [2, 7, 6; 9, 5, 1; 4, 3, 8],
the second row is:
  [2, 9, 7; 11, 6, 1; 5, 3, 10], and so on.
		

Crossrefs

Cf. A217568: the 8 equivalent variants of the first row.
Cf. A320872: subsequence of rows that consist only of primes; A268790 lists their magic sums with duplicates removed.
Cf. A320873: the first row that consists of a set of consecutive primes; it has magic sum = 4440084513 = A270305(1) = A073520(3).

Programs

  • PARI
    A320871_row(N=10,show_all=1,c=3)={for(c=c,oo, forstep(d=c-1,2,-1, for(b=max(2*d+1-c,1), d-1, d!=2*b&& S=[c-d,c+b,c+d-b;c+2*d-b,c,c-2*d+b;c-d+b,c-b,c+d]; !(show_all&&print(S))&& !N--&& return(S))))} \\ The third (optional) argument allows starting the list with the first square(s) having the central element >= c, i.e., magic sum >= 3c.

A269324 Magic sums of 3 X 3 magic squares composed of primes in an arithmetic progression.

Original entry on oeis.org

3117, 3747, 13017, 21309, 28209, 35097, 39099, 39189, 42663, 46923, 52977, 69501, 71061, 73239, 83211, 87663, 88041, 96171, 100767, 104613, 108033, 111831, 112899, 113691, 114159, 117483, 123567, 129939, 135699, 136239, 139917, 141807, 141909, 149241
Offset: 1

Views

Author

Arkadiusz Wesolowski, Feb 23 2016

Keywords

References

  • Joseph S. Madachy, "Magic and Antimagic Squares." Ch. 4 in Madachy's Mathematical Recreations, New York: Dover, 1979, p. 95.

Crossrefs

Cf. A269325. Subsequence of A268790.

A268913 Magic sums of 3 X 3 semimagic squares composed of primes.

Original entry on oeis.org

53, 59, 61, 65, 67, 71, 73, 77, 79, 83, 85, 89, 91, 95, 97, 99, 101, 103, 107, 109, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171
Offset: 1

Views

Author

Arkadiusz Wesolowski, Feb 15 2016

Keywords

Comments

This sequence is infinite because the Green-Tao theorem implies that sequence A268790 is infinite.
I conjecture that every odd number greater than 111 belongs to this sequence.

Examples

			Examples of 3 X 3 semimagic squares composed of primes.
.
|---|---|---|
| 3 | 13| 37|
|---|---|---|
| 31| 17| 5 |
|---|---|---|
| 19| 23| 11|
|---|---|---|
The magic constant is 53 = a(1).
.
|---|---|---|
| 3 | 13| 43|
|---|---|---|
| 37| 17| 5 |
|---|---|---|
| 19| 29| 11|
|---|---|---|
The magic constant is 59 = a(2).
		

Crossrefs

Cf. A268912. Supersequence of A268790.
Showing 1-6 of 6 results.