login
Necklaces with n beads of 5 colors, no 2 adjacent beads the same color.
3

%I #20 Jul 06 2018 08:50:44

%S 5,10,20,70,204,700,2340,8230,29140,104968,381300,1398500,5162220,

%T 19175140,71582940,268439590,1010580540,3817763740,14467258260,

%U 54975633976,209430787820,799645010860,3059510616420,11728124734500

%N Necklaces with n beads of 5 colors, no 2 adjacent beads the same color.

%H Andrew Howroyd, <a href="/A106367/b106367.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 (5, 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) * (4*(-1)^d + 4^d) for n > 1. - _Andrew Howroyd_, Mar 12 2017

%t a[n_] := If[n==1, 5, Sum[EulerPhi[n/d]*(4*(-1)^d+4^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, 5, sumdiv(n, d, eulerphi(n/d)*(4*(-1)^d + 4^d))/n); \\ _Andrew Howroyd_, Oct 14 2017

%Y Column 5 of A208535.

%Y Cf. A000031, A001869.

%K nonn

%O 1,1

%A _Christian G. Bower_, Apr 29 2005