OFFSET
1,6
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..200
Dennis S. Bernstein and Omran Kouba, Counting Colorful Necklaces and Bracelets in Three Colors, arXiv:1901.10703 [math.CO], 2019.
E. Estevez-Rams, C. Azanza-Ricardo, J. Martinez-Garcia and B. Argon-Fernandez, On the algebra of binary codes representing closed-packed staking sequences, Acta Cryst. A61 (2005), 201-208.
E. Esteves-Rams, C. L. Azana Ricardo, B. Aragon Fernandez, An alternative expression for counting the number of close-packaged polytypes, Z. Krist. 220 (2005) 592-595, Table 1
T. J. McLarnan, The numbers of polytypes in close-packings and related structures, Zeits. Krist. 155, 269-291 (1981).
FORMULA
MAPLE
with(numtheory); read transforms; M:=200;
A:=proc(N, d) if d mod 3 = 0 then 2^(N/d) else (1/3)*(2^(N/d)+2*cos(Pi*N/d)); fi; end;
E:=proc(N) if N mod 2 = 0 then N*2^(N/2) + add( did(N/2, d)*phi(2*d)*2^(N/(2*d)), d=1..N/2) else (N/3)*(2^((N+1)/2)+2*cos(Pi*(N+1)/2)); fi; end;
PP:=proc(N) (1/(4*N))*(add(did(N, d)*phi(d)*A(N, d), d=1..N)+E(N)); end;
for N from 1 to M do t1[N]:=PP(N); od:
P:=proc(N) local s, d; s:=0; for d from 1 to N do if N mod d = 0 then s:=s+mobius(N/d)*t1[d]; fi; od: s; end; for N from 1 to M do lprint(N, P(N)); od: # N. J. A. Sloane, Aug 10 2006
MATHEMATICA
M = 40;
did[m_, n_] := If[Mod[m, n] == 0, 1, 0];
A[n_, d_] := If[Mod[d, 3] == 0, 2^(n/d), (1/3)(2^(n/d) + 2 Cos[Pi n/d])];
EE[n_] := If[Mod[n, 2] == 0, n 2^(n/2) + Sum[did[n/2, d] EulerPhi[2d]* 2^(n/(2 d)), {d, 1, n/2}], (n/3)(2^((n+1)/2) + 2 Cos[Pi(n+1)/2])];
PP[n_] := PP[n] = (1/(4n))(Sum[did[n, d] EulerPhi[d] A[n, d], {d, 1, n}] + EE[n]);
P[n_] := Module[{s = 0, d}, For[d = 1, d <= n, d++, If[Mod[n, d] == 0, s += MoebiusMu[n/d] PP[d]]]; s];
Array[P, M] (* Jean-François Alcover, Apr 21 2020, from Maple *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane and Michael OKeeffe (MOKeeffe(AT)asu.edu)
EXTENSIONS
More terms from N. J. A. Sloane, Aug 10 2006
STATUS
approved