login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A329717
a(n) is n (plus or minus) the number of distinct primes dividing n according to parity (even or odd).
1
1, 1, 2, 3, 4, 8, 6, 7, 8, 12, 10, 14, 12, 16, 17, 15, 16, 20, 18, 22, 23, 24, 22, 26, 24, 28, 26, 30, 28, 27, 30, 31, 35, 36, 37, 38, 36, 40, 41, 42, 40, 39, 42, 46, 47, 48, 46, 50, 48, 52, 53, 54, 52, 56, 57, 58, 59, 60, 58, 57, 60, 64, 65, 63, 67, 63, 66
OFFSET
1,3
LINKS
FORMULA
a(n) = n + A001221(n)*(-1)^A001221(n).
EXAMPLE
A001221(3) = 1, so a(3) = 3-1 = 2. A001221(6) = 2, so a(6) = 6+2 = 8.
MATHEMATICA
Array[# + (om = PrimeNu[#]) * (-1)^om &, 67] (* Amiram Eldar, Nov 23 2019 *)
PROG
(PARI) a(n) = my(om=omega(n)); n + (-1)^om*om; \\ Michel Marcus, Nov 20 2019
CROSSREFS
Sequence in context: A082313 A123494 A123716 * A229927 A222256 A367870
KEYWORD
nonn
AUTHOR
Lars Blomberg, Nov 20 2019
STATUS
approved