OFFSET
1,4
COMMENTS
a(n) = A087276(n) - n.
FORMULA
a(1) = 0, a(2n) = 2*a(n) + 1, a(2n+1) = 2*a(n) + floor(log_2(n)) + 1.
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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ralf Stephan, Aug 27 2003
STATUS
approved