login
A366371
Number of divisors of n that are either an odd prime power > 1 or twice such a number.
1
0, 0, 1, 0, 1, 2, 1, 0, 2, 2, 1, 2, 1, 2, 2, 0, 1, 4, 1, 2, 2, 2, 1, 2, 2, 2, 3, 2, 1, 4, 1, 0, 2, 2, 2, 4, 1, 2, 2, 2, 1, 4, 1, 2, 3, 2, 1, 2, 2, 4, 2, 2, 1, 6, 2, 2, 2, 2, 1, 4, 1, 2, 3, 0, 2, 4, 1, 2, 2, 4, 1, 4, 1, 2, 3, 2, 2, 4, 1, 2, 4, 2, 1, 4, 2, 2, 2, 2, 1, 6, 2, 2, 2, 2, 2, 2, 1, 4, 3, 4, 1, 4, 1, 2, 3
OFFSET
1,6
LINKS
FORMULA
a(n) = Sum_{d|n} (1-A354108(d)).
For odd n, a(n) = A001222(n), for even n, a(n) = 2*A001222(A000265(n)).
PROG
(PARI)
A354108(n) = ((n && !bitand(n, n-1)) || !isprimepower(n/(2-(n%2))));
A366371(n) = sumdiv(n, d, !A354108(d));
(Python)
from sympy import factorint
def A366371(n): return sum(factorint(n).values()) if n&1 else sum(factorint(n>>(~n&n-1).bit_length()).values())<<1 # Chai Wah Wu, Nov 24 2023
CROSSREFS
Inverse Möbius transform of the characteristic function (1-A354108) of the complement of A354109.
Cf. A000265, A001222, A067019 (positions of odd terms), A353558 (parity of terms).
Sequence in context: A374366 A229893 A317683 * A198727 A294508 A035152
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 23 2023
STATUS
approved