login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(0)=0; thereafter a(2n+1)=3*a(n)+1, a(2n)=2*a(n)+a(n-1)+1.
2

%I #13 Feb 14 2016 18:52:52

%S 0,1,3,4,8,10,12,13,21,25,29,31,35,37,39,40,56,64,72,76,84,88,92,94,

%T 102,106,110,112,116,118,120,121,153,169,185,193,209,217,225,229,245,

%U 253,261,265,273,277,281,283,299,307,315,319,327,331,335,337

%N a(0)=0; thereafter a(2n+1)=3*a(n)+1, a(2n)=2*a(n)+a(n-1)+1.

%H Colin Barker, <a href="/A268514/b268514.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) = Sum{i=1..n} 2^{number of 0's in binary expansion of i}.

%F a(n) = (A064194(n+1)-1)/2.

%o (PARI) a(n) = sum(i=1, n, b=binary(i); 2^(#b-norml2(b))) \\ _Colin Barker_, Feb 08 2016

%Y Cf. A064194, A023416 (no. of 0's in n).

%Y First differences are (essentially) A080100.

%K nonn

%O 0,3

%A _N. J. A. Sloane_, Feb 07 2016