OFFSET
0
LINKS
FORMULA
a(2n+1) = 1 - a(floor(n/2)) for n >= 0.
a(2n) = a(floor(n/2)) for n > 0 with a(0) = 0.
a(n) = (-1)^n*a(floor(n/4)) + n mod 2 for n > 0 with a(0) = 0.
MATHEMATICA
Array[Mod[Total@ IntegerDigits[#, 4], 2] &, 105, 0] (* Michael De Vlieger, Mar 17 2021 *)
PROG
(PARI) A341389(n) = { my(c=0); while(n, c += (n%2); n >>= 2); (c%2); }; \\ Antti Karttunen, Feb 10 2021
(PARI) a(n) = sumdigits(n, 4) % 2; \\ Kevin Ryde, Feb 14 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Mikhail Kurkov, Feb 10 2021
EXTENSIONS
Terms corrected by Antti Karttunen, Feb 10 2021
STATUS
approved