OFFSET
0,3
COMMENTS
The 1-dimensional (necklace) case is A008965.
We define a toroidal necklace to be an equivalence class of matrices under all possible rotations of the sequence of rows and the sequence of columns. Alternatively, a toroidal necklace is a matrix that is minimal among all possible rotations of its sequence of rows and its sequence of columns.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..200
S. N. Ethier, Counting toroidal binary arrays, J. Int. Seq. 16 (2013) #13.4.7.
EXAMPLE
Inequivalent representatives of the a(6) = 31 toroidal necklaces:
6 15 24 33 114 123 132 222 1113 1122 1212 11112 111111
.
1 2 3 11 11 12 12 111
5 4 3 13 22 12 21 111
.
1 1 1 2 11
1 2 3 2 11
4 3 2 2 11
.
1 1 1
1 1 2
1 2 1
3 2 2
.
1
1
1
1
2
.
1
1
1
1
1
1
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
facs[n_]:=If[n<=1, {{}}, Join@@Table[Map[Prepend[#, d]&, Select[facs[n/d], Min@@#>=d&]], {d, Rest[Divisors[n]]}]];
ptnmats[n_]:=Union@@Permutations/@Select[Union@@(Tuples[Permutations/@#]&/@Map[primeMS, facs[n], {2}]), SameQ@@Length/@#&];
neckmatQ[m_]:=m==First[Union@@Table[RotateLeft[m, {i, j}], {i, Length[m]}, {j, Length[First[m]]}]];
Table[Length[Join@@Table[Select[ptnmats[k], neckmatQ], {k, Times@@Prime/@#&/@IntegerPartitions[n]}]], {n, 10}]
PROG
(PARI)
U(n, m, k) = (1/(n*m)) * sumdiv(n, c, sumdiv(m, d, eulerphi(c) * eulerphi(d) * subst(k, x, x^lcm(c, d))^(n*m/lcm(c, d))));
a(n)={if(n < 1, n==0, sum(i=1, n, sum(j=1, n\i, polcoef(U(i, j, x/(1-x) + O(x*x^n)), n))))} \\ Andrew Howroyd, Aug 18 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Feb 04 2019
EXTENSIONS
Terms a(18) and beyond from Andrew Howroyd, Aug 18 2019
STATUS
approved