OFFSET
0,3
COMMENTS
A slightly different recurrence relation, a(0) = 1, a(n) = n+a(floor(n/2)) if n mod 2 = 0, a(n) = 3n-a(floor((n-1)/2)) if n mod 2 = 1, leads to the odious numbers (odd number of 1's in binary expansion; A000069).
MAPLE
a:=proc(n) if n = 0 then 1 elif n mod 2 = 0 then n+a(floor(n/2)) else 2*n-a(floor((n-1)/2)) fi end: seq(a(n), n=0..70);
MATHEMATICA
a[0] = 1; a[n_] := a[n] = If[Mod[n, 2] == 0, a[Floor[n/2]] + n, -a[Floor[(n - 1)/2]] + 2*n] aa = Table[a[n], {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Jun 18 2005
STATUS
approved