OFFSET
1,2
COMMENTS
Let pp(n) be the prime parity of n, defined as 1 if the number of distinct primes dividing n is odd and -1 if it is even; by convention pp(1) = 0. The cumulative sum of pp is A123066. We call the initial segment of the integers [1..n] balanced with respect to prime parity if the cumulative sum of pp(n) is 0. [1..a(n)] give the balanced segments.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..8908 (terms below 10^10)
Harald Helfgott and Adrián Ubis, Primos, paridad y análisis, Publicaciones Matemáticas del Uruguay, Vol. 18 (2023), pp. 205-283; arXiv preprint, arXiv:1812.08707 [math.NT], 2018-2019.
MAPLE
a_list := proc(len) local omega, c, L, j; c := 0; L := 1;
omega := n -> nops(numtheory[factorset](n));
for j from 2 to len do
c := c + (-1)^omega(j);
if c = 0 then L := L, j fi
od; L end: a_list(10000);
MATHEMATICA
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Dec 21 2018
STATUS
approved