1,2

a(4*n)=3*n iff b(2n)=0 where b(1)=1, b(2n)=(b(2n-1)+b(n)) mod 2, b(2n+1)=b(2n)+1

Table of n, a(n) for n=1..73.

a(n) is asymptotic to 3/4*n.

(PARI) a(n)=if(n<2, 1, if(n%2, a(n-1)+1, a(n-1)+a(n/2)%2))

Sequence in context: A247983 A127036 A108789 * A162621 A180446 A095394

Adjacent sequences: A091957 A091958 A091959 * A091961 A091962 A091963

nonn

Benoit Cloitre, Mar 13 2004

approved