login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 6
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

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.

LINKS

Table of n, a(n) for n=1..63.

Index entries for sequences related to magic squares

EXAMPLE

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).)

PROG

(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 to compute 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.

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.

Sequence in context: A271567 A231704 A033654 * A276318 A282378 A248400

Adjacent sequences:  A320869 A320870 A320871 * A320873 A320874 A320875

KEYWORD

nonn,tabf

AUTHOR

M. F. Hasler, Oct 25 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 18 01:54 EDT 2021. Contains 347504 sequences. (Running on oeis4.)