OFFSET
1
COMMENTS
This is the characteristic function of A325698, see comments there.
LINKS
FORMULA
EXAMPLE
MATHEMATICA
{1}~Join~Array[Boole[#2 == #1 - #2] & @@ {Length[#], Count[#, _?EvenQ]} &@ Flatten@ Apply[ConstantArray[PrimePi[#1], #2] &, FactorInteger[#], {1}] &, 121, 2] (* Michael De Vlieger, Apr 16 2022 *)
PROG
(PARI) A353370(n) = { my(f = factor(n)); (0==sum(i=1, #f~, f[i, 2]*((-1)^(primepi(f[i, 1])%2)))); }; \\ Antti Karttunen, Apr 16 2022
(Python)
from sympy import factorint, primepi
def a(n):
v = [0, 0]
for p, e in factorint(n).items(): v[primepi(p)%2] += e
return int(v[0] == v[1])
print([a(n) for n in range(1, 123)]) # Michael S. Branicky, Apr 16 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 16 2022
STATUS
approved