A083661 G.f.: 1/(1-x) * Sum_{k>=0} x^2^(k+2)/(1+x^2^k).
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, 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, 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
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
- Ralf Stephan, Some divide-and-conquer sequences with (relatively) simple ordinary generating functions, 2004.
- Ralf Stephan, Table of generating functions.
Programs
-
Mathematica
a[n_] := DigitCount[n, 2, 0] + IntegerDigits[n, 2][[2]] - 1; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jul 16 2023 *)
-
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", "))