%I #17 Jul 16 2023 02:07:25
%S 0,0,0,1,0,1,0,2,1,1,0,2,1,1,0,3,2,2,1,2,1,1,0,3,2,2,1,2,1,1,0,4,3,3,
%T 2,3,2,2,1,3,2,2,1,2,1,1,0,4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0,5,4,4,3,4,
%U 3,3,2,4,3,3,2,3,2,2,1,4,3,3,2,3,2,2,1,3,2,2,1,2,1
%N G.f.: 1/(1-x) * Sum_{k>=0} x^2^(k+2)/(1+x^2^k).
%H Amiram Eldar, <a href="/A083661/b083661.txt">Table of n, a(n) for n = 1..10000</a>
%H Ralf Stephan, <a href="/somedcgf.html">Some divide-and-conquer sequences with (relatively) simple ordinary generating functions</a>, 2004.
%H Ralf Stephan, <a href="/A079944/a079944.ps">Table of generating functions</a>.
%F a(1) = a(2) = a(3) = 0, a(2n) = a(n)+1, a(2n+1) = a(n).
%F a(n) = A080791(n) + A079944(n-2) - 1.
%t a[n_] := DigitCount[n, 2, 0] + IntegerDigits[n, 2][[2]] - 1; a[1] = 0; Array[a, 100] (* _Amiram Eldar_, Jul 16 2023 *)
%o (PARI) for(n=1, 120, l=ceil(log(n)/log(2)); t=polcoeff(1/(1-x)*sum(k=0, l, (x^2^(k+2))/(1+x^2^k)) + O(x^(n+1)), n); print1(t", "))
%Y Cf. A000120, A023416, A079944, A080791.
%K nonn,easy
%O 1,8
%A _Ralf Stephan_, Jun 14 2003