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”).

A359469
a(n) = A353459(n) mod 2.
3
0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1
OFFSET
1
FORMULA
For all n >= 1, a(n) = a(A003961(n)) = a(A348717(n)).
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))); };
A353459(n) = (A353457(n)+A353458(n));
A359469(n) = (A353459(n)%2);
(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.
Differs from A359466 and A359467 for the first time at n=100, as here a(100) = 1.
Sequence in context: A345952 A359466 A359467 * A107078 A341613 A163533
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 04 2023
STATUS
approved