login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 3
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
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.
LINKS
EXAMPLE
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.
PROG
(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.
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).
Sequence in context: A308682 A117968 A217568 * A154200 A089417 A168205
KEYWORD
nonn,tabf
AUTHOR
M. F. Hasler, Oct 28 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 08:56 EDT 2024. Contains 371934 sequences. (Running on oeis4.)