login
A394789
Number of positive integers <= n with exactly two odd divisors.
2
0, 0, 1, 1, 2, 3, 4, 4, 4, 5, 6, 7, 8, 9, 9, 9, 10, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 19, 20, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 29, 29, 29, 29, 30, 31, 31, 31, 32, 32, 33, 34, 34, 35, 36, 36, 36, 36, 36, 37, 38, 38, 38, 39, 39, 40, 41, 41, 42, 42, 42
OFFSET
1,5
COMMENTS
a(n) is also the number of positive integers <= n with two partitions into consecutive parts.
a(n) is also the number of positive integers m <= n whose symmetric representation of sigma(m) has two subparts.
EXAMPLE
The first number with two odd divisors is 3 so a(3) = 1.
4 has only one odd divisor so a(4) = a(3) = 1.
The second number with two odd divisors is 5 so a(5) = 2.
The third number with two odd divisors is 6 so a(6) = 3.
The two partitions of 3 into consecutive parts are [3], [2, 1].
The two partitions of 5 into consecutive parts are [5], [3, 2].
The two partitions of 6 into consecutive parts are [6], [3, 2, 1].
MATHEMATICA
seq[n_] := Accumulate[Table[Boole[DivisorSigma[0, k/2^IntegerExponent[k, 2]] == 2], {k, 1, n}]]; seq[100] (* Amiram Eldar, Apr 03 2026 *)
PROG
(Python)
from sympy import primepi
def A394789(n): return -(m:=n.bit_length()-1)+sum(primepi(n>>i) for i in range(m)) # Chai Wah Wu, Apr 13 2026
CROSSREFS
Column 2 of A394053.
Sequence in context: A099479 A120508 A199332 * A029085 A087875 A195848
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Apr 03 2026
STATUS
approved