OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
FORMULA
a(2^k) = A193231(k). - Peter Munn, May 07 2020
From Peter Munn, Jun 02 2020: (Start)
Alternative definition, for n, k >= 1, where XOR denotes A003987:
a(prime(n)) = 1, where prime(n) = A000040(n);
a(n^2) = a(n) XOR (2 * a(n)) = A048720(a(n), 3);
a(A059897(n, k)) = a(n) XOR a(k).
(End)
MATHEMATICA
f[n_] := Which[0 <= # <= 1, #, EvenQ@ #, BitXor[2 #, #] &[f[#/2]], True, BitXor[#, 2 # + 1] &[f[(# - 1)/2]]] &@ Abs@ n; {0}~Join~Table[f[BitXor @@ Map[Last, FactorInteger@ n]], {n, 2, 120}] (* Michael De Vlieger, Feb 12 2016, after Robert G. Wilson v at A048724 and A065621 *)
PROG
(PARI)
a268387(n) = {my(f = factor(n), b = 0); for (k=1, #f~, b = bitxor(b, f[k, 2]); ); b; }
a193231(n) = {my(x='x); subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2)};
a(n) = a193231(a268387(n)); \\ Michel Marcus, May 09 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 10 2016
STATUS
approved