OFFSET
1,5
COMMENTS
Parity of sum(i=1,2n-1,a(i)) = parity of n.
FORMULA
MATHEMATICA
a[1] = 1; a[n_] := a[n] = If[ EvenQ[n], Mod[ a[n/2] + 1, 2], a[n - 1] + 1]; Table[ a[n], {n, 105}] (* Robert G. Wilson v, Nov 03 2005 *)
PROG
(PARI) a(n)=if(n<2, 1, if(n%2, (a(n-1)+1), (a(n/2)+1)%2))
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Mar 09 2004
EXTENSIONS
Duplicate Mathematica program removed by Harvey P. Dale, May 26 2023
STATUS
approved