

A327666


a(n) = Sum_{k = 1..n} (1)^(Omega(k)  omega(k)), where Omega(k) counts prime factors of k with multiplicity and omega(k) counts distinct prime factors.


2



1, 2, 3, 2, 3, 4, 5, 6, 5, 6, 7, 6, 7, 8, 9, 8, 9, 8, 9, 8, 9, 10, 11, 12, 11, 12, 13, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 26, 25, 26, 27, 26, 25, 24, 25, 24, 25, 26, 27, 28, 29, 30, 31, 30, 31, 32, 31, 30, 31, 32, 33, 32, 33, 34
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS



LINKS



FORMULA

a(1) = 1, a(n) = a(n  1) + (1)^(Omega(n)  omega(n)) for n > 1.


EXAMPLE

Omega(1) = omega(1) = 0. The difference is 0, so (1)^0 = 1, so a(1) = 1.
Omega(2) = omega(2) = 1. The difference is 0, so (1)^0 = 1, which is added to a(1) to give a(2) = 2.
Omega(3) = omega(3) = 1. The difference is 0, so (1)^0 = 1, which is added to a(2) to give a(3) = 3.
Omega(4) = 2 but omega(4) = 1. The difference is 1, so (1)^1 = 1, which is added to a(3) to give a(4) = 2.


MATHEMATICA

Table[Sum[(1)^(PrimeOmega[k]  PrimeNu[k]), {k, n}], {n, 70}]
f[p_, e_] := (1)^(e  1); Accumulate @ Table[Times @@ f @@@ FactorInteger[n], {n, 1, 100}] (* Amiram Eldar, Sep 18 2022 *)


PROG

(PARI) seq(n)={my(v=vector(n)); v[1]=1; for(k=2, n, v[k] = v[k1] + (1)^(bigomega(k)omega(k))); v} \\ Andrew Howroyd, Sep 23 2019
(Python)
from functools import reduce
from sympy import factorint
def A327666(n): return sum(1 if reduce(lambda a, b:~(a^b), factorint(i).values(), 0)&1 else 1 for i in range(1, n+1)) # Chai Wah Wu, Jan 01 2023


CROSSREFS

Cf. A001221, A001222, A002321, A002819, A008836, A046660, A069812, A076479, A162511, A174863, A307868.


KEYWORD

nonn


AUTHOR



STATUS

approved



