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.
%I A320871 #13 Apr 17 2022 03:54:55 %S A320871 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, %T A320871 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, %U A320871 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 %N 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. %C A320871 "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. %C A320871 The 8 ("equivalent") variants of the first square are listed in A217568. %e A320871 The first five inequivalent magic squares (with magic sums 15, 18, 18, 18, 21) are %e A320871 [2 7 6] [ 2 9 7] [ 3 7 8] [ 3 8 7] [ 2 11 8] %e A320871 [9 5 1] [11 6 1] [11 6 1] [10 6 2] [13 7 1] %e A320871 [4 3 8] [ 5 3 10] [ 4 5 9] [ 5 4 9] [ 6 3 12] %e A320871 They are listed as rows of the 9 elements of each square, so the first row is: %e A320871 [2, 7, 6; 9, 5, 1; 4, 3, 8], %e A320871 the second row is: %e A320871 [2, 9, 7; 11, 6, 1; 5, 3, 10], and so on. %o A320871 (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. %Y A320871 Cf. A217568: the 8 equivalent variants of the first row. %Y A320871 Cf. A320872: subsequence of rows that consist only of primes; A268790 lists their magic sums with duplicates removed. %Y A320871 Cf. A320873: the first row that consists of a set of consecutive primes; it has magic sum = 4440084513 = A270305(1) = A073520(3). %K A320871 nonn,tabf %O A320871 1,1 %A A320871 _M. F. Hasler_, Oct 28 2018