OFFSET
1,4
COMMENTS
The sums of the first 10^k terms, for k = 1, 2, ..., are 11, 139, 1427, 14207, 141970, 1418563, 14183505, 141834204, 1418330298, 14183245181, ... . Apparently, the asymptotic mean of this sequence is limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1.4183... . - Amiram Eldar, Sep 10 2022
LINKS
FORMULA
a(1) = 0; for n > 1: a(n) = A067029(n) XOR a(A028234(n)). [Here XOR stands for bitwise exclusive-or, A003987.]
Other identities and observations. For all n >= 1:
From Peter Munn, Dec 02 2019 with XOR used as above: (Start)
Defined by: a(p^k) = k, for prime p; a(A059897(n,k)) = a(n) XOR a(k).
(End)
MATHEMATICA
Table[BitXor @@ Map[Last, FactorInteger@ n], {n, 120}] (* Michael De Vlieger, Feb 12 2016 *)
PROG
(Scheme, with memoization-macro definec)
(definec (A268387 n) (cond ((= 1 n) 0) (else (A003987bi (A067029 n) (A268387 (A028234 n)))))) ;; A003987bi implements bitwise-xor (see A003987).
(PARI) a(n) = {my(f = factor(n)); my(b = 0); for (k=1, #f~, b = bitxor(b, f[k, 2]); ); b; } \\ Michel Marcus, Feb 06 2016
(Python)
from functools import reduce
from operator import xor
from sympy import factorint
def A268387(n): return reduce(xor, factorint(n).values(), 0) # Chai Wah Wu, Aug 31 2022
CROSSREFS
Cf. A268390 (indices of zeros).
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Feb 05 2016
STATUS
approved