%I #25 Apr 15 2024 09:36:27
%S 1,1,1,1,2,3,3,7,8,14,15,31,30,63,63,123,128,255,252,511,510,1015,
%T 1023,2047,2040,4092,4095,8176,8190,16383,16365,32767,32768,65503,
%U 65535,131061,131040,262143,262143,524223,524280,1048575,1048509,2097151
%N Number of 2n-bead balanced binary necklaces of fundamental period 2n which are equivalent to their reverse, complement and reversed complement.
%H Andrew Howroyd, <a href="/A045683/b045683.txt">Table of n, a(n) for n = 0..200</a>
%H J. E. Iglesias, <a href="https://doi.org/10.1524/zkri.2006.221.4.237">Enumeration of closest-packings by the space group: a simple approach</a>, Z. Krist. 221 (2006) 237-245, Table 3.
%H <a href="/index/Lu#Lyndon">Index entries for sequences related to Lyndon words</a>
%F Moebius transform of A045674. - _Andrew Howroyd_, Sep 29 2017
%F From _Andrew Howroyd_, Oct 02 2019: (Start)
%F a(n) = Sum_{d|n, d odd} mu(d) * 2^floor((n/d-1)/2) for n > 0.
%F G.f.: 1 + Sum_{k>0} mu(2*k-1)*x^(2*k-1)*(1 + x^(2*k-1))/(1 - 2*x^(4*k-2)).
%F (End)
%p A045683 := proc(p)
%p option remember ;
%p if p = 0 then
%p return 1;
%p end if;
%p a := 2^(floor((p+1)/2)-1) ;
%p for d in numtheory[divisors](p) do
%p if d >1 and type(d,'odd') then
%p a := a-procname(p/d) ;
%p end if;
%p end do:
%p a ;
%p end proc:
%p seq(A045683(p),p=0..30) ; # [Iglesias eq 12] _R. J. Mathar_, Apr 15 2024
%t b[0] = 1; b[n_] := Module[{t = 0, r = n}, While[EvenQ[r], r = Quotient[r, 2]; t += 2^(r-1)]; t + 2^Quotient[r, 2]];
%t a[0] = 1; a[n_] := DivisorSum[n, MoebiusMu[n/#]*b[#]&];
%t Table[a[n], {n, 0, 43}] (* _Jean-François Alcover_, Sep 30 2017, after _Andrew Howroyd_ *)
%o (PARI) a(n)={if(n<1, n==0, sumdiv(n, d, if(d%2, moebius(d)*2^((n/d-1)\2))))} \\ _Andrew Howroyd_, Oct 01 2019
%Y Cf. A045665, A045674, A045680, A011947 (bisection?).
%K nonn,easy
%O 0,5
%A _David W. Wilson_