OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..1667
S. N. Ethier, Counting toroidal binary arrays, arXiv preprint arXiv:1301.2352 [math.CO], 2013.
S. N. Ethier, Counting toroidal binary arrays, J. Int. Seq. 16 (2013) #13.4.7.
Peter Kagey and William Keehn, Counting tilings of the n X m grid, cylinder, and torus, arXiv:2311.13072 [math.CO], 2023. See p. 3.
MATHEMATICA
b1[m_, n_] := Sum[EulerPhi[c]*EulerPhi[d]*2^(m*n/LCM[c, d]), {c, Divisors[ m]}, {d, Divisors[n]}]/(4*m*n);
b2a[m_, n_] := If[OddQ[m], 2^((m+1)*n/2)/(4n), (2^(m*n/2) + 2^((m+2)*n/2))/(8n)];
b2b[m_, n_] := DivisorSum[n, If[# >= 2, EulerPhi[#]*2^((m*n)/#), 0]&]/(4n);
b2c[m_, n_] := If[OddQ[m], Sum[If[OddQ[n/GCD[j, n]], 2^((m+1)*GCD[j, n]/2) - 2^(m*GCD[j, n]), 0], {j, 1, n-1}]/(4*n), Sum[If[OddQ[n/GCD[j, n]], 2^(m*GCD[j, n]/2) + 2^((m+2)*GCD[j, n]/2) - 2^(m*GCD[j, n]+1), 0], {j, 1, n-1}]/(8n)];
b2[m_, n_] := b2a[m, n] + b2b[m, n] + b2c[m, n];
b3[m_, n_] := b2[n, m]; b4oo[m_, n_] := 2^((m*n - 3)/2);
b4eo[m_, n_] := 3*2^(m*n/2 - 3); b4ee[m_, n_] := 7*2^(m*n/2 - 4);
a[m_, n_] := Module[{b}, If[OddQ[m], If[OddQ[n], b = b4oo[m, n], b = b4eo[m, n]], If[OddQ[n], b = b4eo[m, n], b = b4ee[m, n]]]; b += b1[m, n] + b2[m, n] + b3[m, n]; Return[b]];
a[m_] := a[m, 2];
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 11 2013
EXTENSIONS
More terms from Michel Marcus, Feb 17 2013
STATUS
approved