|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
COMMENTS
|
This is the characteristic function of A325698, see comments there.
|
|
LINKS
|
|
|
FORMULA
|
a(p) = 0 for all primes p.
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])
|
|
CROSSREFS
|
Characteristic function of A325698.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|