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.

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

This page as a plain text file.
%I A217568 #52 Feb 16 2025 08:33:18
%S A217568 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,
%T A217568 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,
%U A217568 9,6,7,2
%N A217568 Rows of the 8 magic squares of order 3 and magic sum 15, lexicographically sorted.
%C A217568 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
%H A217568 Eric Weisstein, <a href="https://mathworld.wolfram.com/MagicSquare.html">MathWorld: Magic Square</a>
%H A217568 Wikipedia, <a href="http://en.wikipedia.org/wiki/Magic_square">Magic Square</a>
%H A217568 <a href="/index/Mag#magic">Index entries for sequences related to magic squares</a>
%e A217568 The first such magic square is
%e A217568 2, 7, 6
%e A217568 9, 5, 1
%e A217568 4, 3, 8
%e A217568 From _M. F. Hasler_, Sep 23 2018: (Start)
%e A217568 The complete table reads:
%e A217568 [2, 7, 6, 9, 5, 1, 4, 3, 8]
%e A217568 [2, 9, 4, 7, 5, 3, 6, 1, 8]
%e A217568 [4, 3, 8, 9, 5, 1, 2, 7, 6]
%e A217568 [4, 9, 2, 3, 5, 7, 8, 1, 6]
%e A217568 [6, 1, 8, 7, 5, 3, 2, 9, 4]
%e A217568 [6, 7, 2, 1, 5, 9, 8, 3, 4]
%e A217568 [8, 1, 6, 3, 5, 7, 4, 9, 2]
%e A217568 [8, 3, 4, 1, 5, 9, 6, 7, 2] (End)
%t A217568 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
%o A217568 (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
%Y A217568 Cf. A320871, A320872, A320873: inequivalent 3 X 3 magic squares of distinct integers, primes, consecutive primes.
%K A217568 easy,fini,nonn,full,tabf
%O A217568 1,1
%A A217568 _Jean-François Alcover_, Oct 08 2012