1, 0, 0, 0, 0, 3, 0, 1, 22, 346, 2060, 7989, 17160, 14662, 3120, 880
Offset: 1
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.
Comments