OFFSET
1,2
EXAMPLE
a(6)=6+3+4+2+1-1=15
MATHEMATICA
f[1] = 1; f[n_] := Block[{lst = {n}, a}, While[a = lst[[ -1]]; a != 1, If[EvenQ@ a, AppendTo[lst, a/2], AppendTo[lst, lst[[1]] - (a + 1)/2]]]; Plus @@ lst - 1]; Array[f, 58] (* Robert G. Wilson v *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Yasutoshi Kohmoto, Apr 23 2008
EXTENSIONS
More terms from Robert G. Wilson v, May 15 2008
STATUS
approved