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!)
A217568 Rows of the 8 magic squares of order 3 and magic sum 15, lexicographically sorted. 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

REFERENCES

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

LINKS

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

Eric Weisstein, MathWorld: Magic Square

Wikipedia, Magic Square

Index entries for sequences related to magic squares

EXAMPLE

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)

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

PROG

(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

CROSSREFS

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

Sequence in context: A138283 A308682 A117968 * A320871 A154200 A089417

Adjacent sequences:  A217565 A217566 A217567 * A217569 A217570 A217571

KEYWORD

easy,fini,nonn,full,tabf

AUTHOR

Jean-Fran├žois Alcover, Oct 08 2012

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 May 21 05:37 EDT 2022. Contains 353889 sequences. (Running on oeis4.)