login
A353370
a(n) = 1 if the prime factorization of n contains as many even as odd prime indices, when counted with multiplicity, otherwise 0.
5
1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1
OFFSET
1
COMMENTS
This is the characteristic function of A325698, see comments there.
FORMULA
a(p) = 0 for all primes p.
a(n) = a(A003961(n)) = a(A348717(n)), for all n >= 1.
If a(x)+a(y) > 0, then a(x*y) = a(x)*a(y).
EXAMPLE
For n = 84 = 2 * 2 * 3 * 7 the condition is satisfied, because it has two instances of odd-indexed primes (A031368), namely (2*2), and also two instances (3 and 7) of the even-indexed primes (A031215), therefore a(84) = 1.
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
Characteristic function of A325698.
Cf. A003961, A031215, A031368, A348717, A353371, A353372 (inverse Möbius transform), A353373.
Cf. also A353331.
Sequence in context: A132918 A358750 A205809 * A355940 A348033 A327153
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 16 2022
STATUS
approved