This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A161222 #2 Mar 30 2012 16:51:25 %S A161222 1,8,30,120,618,3536,22668,151848,1054986,7472984,53737896,390582648, %T A161222 2863716060,21145502960,157076310324,1172820793824,8796118712586, %U A161222 66229473393728,500400163666188,3792505486235544,28823039252629512,219604100410657136,1676976747053723292 %N A161222 Consider necklaces with n beads, each of one of four colors (say C1, C2, C3, C4), where the n segments of cord between the beads are each colored red or green; a(n) is the number of different necklaces under the action of the dihedral group D_{2n}. %C A161222 If the group is changed to C_n we get A054627. %F A161222 For formula see Maple code. %p A161222 with(numtheory); f:=proc(n) local t1,d,m; %p A161222 if n mod 2 = 0 then m:=n/2; t1:=3*2^(3*m); %p A161222 else m:=(n-1)/2; t1:=2^(3*m+3); fi; %p A161222 (1/2)*( (1/n) * add( phi(d)*2^(3*n/d), d in divisors(n)) + t1 ); %p A161222 end; # this assumes n>0 %Y A161222 Cf. A161221, A054627. %K A161222 nonn %O A161222 0,2 %A A161222 H. O. Pollak (hpollak(AT)adsight.com) and _N. J. A. Sloane_, Nov 21 2009