OFFSET
1,2
COMMENTS
a(n) = A087275(n) + n.
FORMULA
a(1) = 1, a(2n) = 2a(n) + 1, a(2n+1) = 2*a(n) + floor(log_2(n)) + 2.
PROG
(PARI) a(n)=local(v, s, l); v=binary(n); l=length(v); s=0; for(k=2, l, s=s+2^(l-k)+sum(m=k+1, l, v[m]*2^(l-m))); s+n
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ralf Stephan, Aug 27 2003
STATUS
approved