OFFSET
0,3
FORMULA
Recurrence: a(2n) = a(n) + [(n+1)/2] + 1, a(2n+1) = 2n.
G.f.: Sum_{k>=0} t^2(3+2t+2t^3-t^4)/[(1+t^2)(1-t^2)^2], t=x^2^k.
PROG
(PARI) a(n)=if(n<1, 0, if(n%2==0, a(n/2)+2*floor((n+2)/4)+1, n-1))
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Mar 16 2004
STATUS
approved