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], BitOr[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 108}] (* Michael De Vlieger, Mar 22 2017 *)
PROG
(Scheme) (define (A283976 n) (if (even? n) (A002487 n) (A003986bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A003986bi implements bitwise-OR (A003986).
(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, bitor(A(n\2), A((n + 1)/2)), A(n\2)));
for(n=0, 101, print1(a(n), ", ")) \\ Indranil Ghosh, Mar 23 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Mar 21 2017
STATUS
approved