OFFSET
1,2
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..8192
Rémy Sigrist, Colored scatterplot of the first 2^18 terms (where the color is function of A007814(n))
EXAMPLE
For n = 6:
- the divisors of 6 are 1, 2, 3 and 6,
- so a(6) = 1 XOR 4 XOR 9 XOR 36 = 40.
MATHEMATICA
Table[BitXor@@(Divisors[n]^2), {n, 50}] (* Harvey P. Dale, May 03 2023 *)
PROG
(PARI) a(n) = my (s=0); fordiv (n, d, s=bitxor(s, d^2)); s
(Python)
from functools import reduce
from operator import xor
from sympy import divisors
def A331700(n): return reduce(xor, (d**2 for d in divisors(n, generator=True))) # Chai Wah Wu, Jul 01 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 25 2020
STATUS
approved