OFFSET
0,3
LINKS
FORMULA
a(2n) = a(n) + 2^(n-1), a(2n+1) = 2^n. - Ralf Stephan, Nov 01 2003
MATHEMATICA
a[0] = 1; a[n_] := a[n] = If[EvenQ[n], 2^(n/2-1) + a[n/2], 2^((n-1)/2)]; Table[a[n], {n, 0, 42}] (* Jean-François Alcover, Sep 30 2017 *)
PROG
(PARI) a(n) = if(n<1, n==0, my(t=0, r=n); while(r%2==0, r=r/2; t+=2^(r-1)); t + 2^(r\2)); \\ Andrew Howroyd, Sep 29 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved