A355487 Bitwise XOR of the base-4 digits of n.
0, 1, 2, 3, 1, 0, 3, 2, 2, 3, 0, 1, 3, 2, 1, 0, 1, 0, 3, 2, 0, 1, 2, 3, 3, 2, 1, 0, 2, 3, 0, 1, 2, 3, 0, 1, 3, 2, 1, 0, 0, 1, 2, 3, 1, 0, 3, 2, 3, 2, 1, 0, 2, 3, 0, 1, 1, 0, 3, 2, 0, 1, 2, 3, 1, 0, 3, 2, 0, 1, 2, 3, 3, 2, 1, 0, 2, 3, 0, 1, 0, 1, 2, 3, 1, 0, 3
Offset: 0
Examples
n=35 has base-4 digits 203 so a(35) = 2 XOR 0 XOR 3 = 1.
Links
Crossrefs
Programs
-
Mathematica
a[n_] := BitXor @@ IntegerDigits[n, 4]; Array[a, 100, 0] (* Amiram Eldar, Jul 05 2022 *)
-
PARI
a(n) = if(n==0,0, fold(bitxor,digits(n,4)));
-
Python
from operator import xor from functools import reduce from sympy.ntheory import digits def a(n): return reduce(xor, digits(n, 4)[1:]) print([a(n) for n in range(87)]) # Michael S. Branicky, Jul 05 2022
Formula
Fixed point of the morphism 0 -> 0,1; 1 -> 2,3; 2 -> 1,0; 3 -> 3,2 starting from 0.
Comments