OFFSET
0,6
LINKS
FORMULA
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[If[EvenQ@ n, a[n/2], BitXor[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 112}] (* Michael De Vlieger, Mar 22 2017 *)
PROG
(Scheme) (define (A283977 n) (if (even? n) (A002487 n) (A003987bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A003987bi implements bitwise-XOR (A003987).
(PARI) A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
a(n) = if(n<2, n, if(n%2, bitxor(A(n\2), A((n + 1)/2)), A(n\2)));
for(n=0, 120, print1(a(n), ", ")) \\ Indranil Ghosh, Mar 23 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Mar 21 2017
STATUS
approved