OFFSET
1
LINKS
PROG
(PARI)
A353457(n) = { my(f=factor(n)); prod(i=1, #f~, if(!(primepi(f[i, 1])%2), 1, if(f[i, 2]==1, -1, 0))); };
A353458(n) = { my(f=factor(n)); prod(i=1, #f~, if(primepi(f[i, 1])%2, 1, if(f[i, 2]==1, -1, 0))); };
(Python)
from functools import reduce
from operator import iand
from sympy import factorint, primepi
def A359469(n):
f = [(primepi(p)&1, int(e==1)) for p, e in factorint(n).items()]
return reduce(iand, (e for p, e in f if not p), 1)^reduce(iand, (e for p, e in f if p), 1) # Chai Wah Wu, Jan 06 2023
CROSSREFS
Characteristic function of A359470.
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 04 2023
STATUS
approved