A345222 Number of divisors of n with a prime number of divisors.
0, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 3, 1, 3, 1, 3, 2, 2, 1, 3, 2, 2, 2, 3, 1, 3, 1, 3, 2, 2, 2, 4, 1, 2, 2, 3, 1, 3, 1, 3, 3, 2, 1, 4, 2, 3, 2, 3, 1, 3, 2, 3, 2, 2, 1, 4, 1, 2, 3, 4, 2, 3, 1, 3, 2, 3, 1, 4, 1, 2, 3, 3, 2, 3, 1, 4, 3, 2, 1, 4, 2, 2, 2, 3, 1, 4, 2, 3, 2
Offset: 1
Examples
a(12) = 3; The divisors of 12 are {1, 2, 3, 4, 6, 12} and the corresponding number of divisors of each of these numbers is {1, 2, 2, 3, 4, 6}. Thus, there are 3 divisors of 12 with a prime number of divisors.
Links
Programs
-
Mathematica
Table[Sum[(PrimePi[DivisorSigma[0, k]] - PrimePi[DivisorSigma[0, k] - 1]) (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}] f[p_, e_] := PrimePi[e+1]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a,100] (* Amiram Eldar, Oct 06 2023 *)
-
PARI
a(n) = sumdiv(n, d, isprime(numdiv(d))); \\ Michel Marcus, Jun 11 2021
Formula
a(n) = Sum_{d|n} c(tau(d)), where c(n) is the prime characteristic.
From Amiram Eldar, Oct 06 2023: (Start)
Additive with a(p^e) = primepi(e+1).
Sum_{k=1..n} a(k) ~ n * (log(n) + B + C), where B is Mertens's constant (A077761), and C = Sum_{k>=2} P(prime(k)-1) = 0.54756961912815344341..., where P(s) is the prime zeta function. (End)
Comments