reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
A number m is oddly or evenly factored depending on whether m has an odd or even number of prime factors, e.g. , 12 = 2.*2.*3 has 3 factors so is oddly factored.
(Python)
proposed
editing
editing
proposed
(Python)
(Python)
from functools import reduce
from operator import ixor
from sympy import factorint
def A072203(n): return 1+sum(1 if reduce(ixor, factorint(i).values(), 0)&1 else -1 for i in range(1, n+1)) # Chai Wah Wu, Dec 20 2022
approved
editing
proposed
approved
editing
proposed
Table[1 - Sum[(-1)^PrimeOmega[i], {i, 1, n}], {n, 1, 100}] (* Indranil Ghosh, Mar 17 2017 *)
(PARI) a(n) = 1 - sum(i=1, n, (-1)^bigomega(i));
for(n=1, 100, print1(a(n), ", ")) \\ Indranil Ghosh, Mar 17 2017
approved
editing
proposed
approved