login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A331700
Binary XOR of squares of divisors of n.
1
1, 5, 8, 21, 24, 40, 48, 85, 89, 120, 120, 168, 168, 240, 240, 341, 288, 317, 360, 504, 384, 408, 528, 680, 617, 520, 640, 1008, 840, 816, 960, 1365, 1072, 1440, 1248, 1197, 1368, 1224, 1360, 2040, 1680, 1920, 1848, 1560, 1864, 2640, 2208, 2728, 2385, 3021
OFFSET
1,2
LINKS
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