%I #19 Jul 06 2018 08:50:51
%S 4,6,8,24,48,130,312,834,2192,5934,16104,44368,122640,341802,956632,
%T 2690844,7596480,21524542,61171656,174342216,498112272,1426419858,
%U 4093181688,11767920118,33891544416,97764131646,282429537944
%N Necklaces with n beads of 4 colors, no 2 adjacent beads the same color.
%H Andrew Howroyd, <a href="/A106366/b106366.txt">Table of n, a(n) for n = 1..200</a>
%H <a href="/index/Ne#necklaces">Index entries for sequences related to necklaces</a>
%F CycleBG transform of (4, 0, 0, 0, ...)
%F CycleBG transform T(A) = invMOEBIUS(invEULER(Carlitz(A)) + A(x^2) - A) + A.
%F Carlitz transform T(A(x)) has g.f. 1/(1-Sum_{k>0} (-1)^(k+1)*A(x^k)).
%F a(n) = (1/n) * Sum_{d | n} totient(n/d) * (3*(-1)^d + 3^d) for n > 1. - _Andrew Howroyd_, Mar 12 2017
%t a[n_] := If[n==1, 4, Sum[EulerPhi[n/d]*(3*(-1)^d+3^d), {d, Divisors[n]}]/n ];
%t Array[a, 35] (* _Jean-François Alcover_, Jul 06 2018, after _Andrew Howroyd_ *)
%o (PARI) a(n) = if(n==1, 4, sumdiv(n, d, eulerphi(n/d)*(3*(-1)^d + 3^d))/n); \\ _Andrew Howroyd_, Oct 14 2017
%Y Column 4 of A208535.
%Y Cf. A000031, A001868, A226493.
%K nonn
%O 1,1
%A _Christian G. Bower_, Apr 29 2005