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.

Showing 1-2 of 2 results.

A087074 For n > 0, 0 <= k <= n^2, T(n,k) is the number of rotationally and reflectively distinct n X n arrays that contain the numbers 1 through k once each and n^2-k zeros.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 3, 1, 3, 12, 66, 378, 1890, 7560, 22680, 45360, 45360, 1, 3, 33, 426, 5466, 65520, 720720, 7207200, 64864800, 518918400, 3632428800, 21794572800, 108972864000, 435891456000, 1307674368000, 2615348736000, 2615348736000, 1
Offset: 1

Views

Author

Zak Seidov and Eric W. Weisstein, Aug 08 2003

Keywords

Examples

			1,1; 1,1,2,3,3; 1,3,12,66,378,1890,7560,22680,45360,45360; ...
There is a single distinct 3 X 3 matrix containing all zeros, so a(3,1)=1.
There are 3 distinct 3 X 3 matrices containing a 1 and otherwise 0's, so a(3,2)=3.
There are 12 distinct 3 X 3 matrices containing a single 1, a single 2 and otherwise 0's, so a(3,3)=12.
There is a single distinct 3 X 3 matrix containing all zeros, so a(3, 0) = 1.
There are 3 distinct 3 X 3 matrices containing 8 0's and a 1, so a(3, 1) = 3.
There are 12 distinct 3 X 3 matrices containing a single 1, a single 2 and otherwise 0's, so a(3, 2) = 12.
		

Crossrefs

Programs

  • Mathematica
    (For 3 X 3 case) CanonicalizeArray[ x_ ] := Module[ {r, t}, Sort[ {x, Reverse[ x ], r=Reverse/@x, Reverse[ r ], t=Transpose[ x ], Reverse[ t ], r=Reverse/@t, Reverse[ r ]} ][ [ 1 ] ] ] ADD[ n_, d_ ] := Union[ CanonicalizeArray /@ (Partition[ #, n ] & /@ Permutations[ Join[ Range[ d ], Table[ 0, {n^2 - d} ] ] ]) ]

Formula

Extensions

More terms from David Wasserman, Apr 12 2005

A364527 Triangle read by rows giving the number of square arrays composed of the numbers from 1 to n^2, counted up to rotation and reflection, with heterogeneity k, i.e., number of k different sums of rows, columns or diagonals with 1 <= k <= 2*n+2 for n > 1.

Original entry on oeis.org

1, 0, 0, 0, 0, 3, 0, 1, 22, 346, 2060, 7989, 17160, 14662, 3120, 880
Offset: 1

Views

Author

Martin Renner, Jul 27 2023

Keywords

Comments

T(n,1) gives the number of magic squares A006052(n).
For n > 1, T(n,2*n+2) gives the number of squares with maximum heterogeneity, i.e., all sums are different (but do not necessarily form a sequence of consecutive integers), sometimes called (super)heterogeneous squares or antimagic squares.
Subsets of T(n,2) or T(n,3) with one or both of the diagonal sums not equal to the magic constant are sometimes called semimagic squares.
Sum_{k=1..2*n+2} T(n,k) = A086829(n) = (n^2)!/8 for n > 1.

Examples

			T(n,k) starts with
  n = 1: 1;
  n = 2: 0, 0, 0, 0, 3, 0;
  n = 3: 1, 22, 346, 2060, 7989, 17160, 14662, 3120;
etc.
For n = 2 there are only three square arrays up to rotation and reflection, all of heterogeneity k = 5, i.e.,
  [1 2] [1 2] [1 3]
  [3 4] [4 3] [4 2]
since there are always the five different sums of rows, columns and diagonals 3, 4, 5, 6 and 7.
For n = 3 the lexicographically first square arrays of heterogeneity 1 <= k <= 8 are
  [2 7 6] [1 2 6] [1 2 5] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]
  [9 5 1] [5 9 4] [3 9 6] [5 6 4] [4 5 6] [4 5 7] [4 5 6] [4 5 8]
  [4 3 8] [3 7 8] [4 7 8] [9 7 8] [7 8 9] [6 9 8] [7 9 8] [6 9 7]
For k = 1 we have the famous Lo Shu square with magic sum (n^3+n)/2 = 15. The other sums for the given examples are (9, 18), (8, 18, 19), (6, 15, 18, 24), (6, 12, 15, 18, 24), (6, 11, 14 16, 18, 23), (6, 12, 14, 15, 16, 17, 24) and (6, 11, 13, 14, 16, 17, 18, 22). Note that there are different sets of sums, namely a total of 6 with two values, 61 with three, 348 with four, 1295 with five, 2880 with six, 3845 with seven and 1538 with eight.
		

References

  • Pierre Berloquin, Garten der Sphinx. 150 mathematische Denkspiele, München 1984, p. 20, nr. 15 (Heterogene Quadrate), p. 20, nr. 16 (Antimagie), p. 86, nr. 148 (Höhere Antimagie), pp. 99-100, 178 (Solutions).

Crossrefs

Showing 1-2 of 2 results.