login
A390951
a(1) = 1; for n > 1, a(n) is the number of integers k in [prime(n-1)^3..prime(n)^3 - 1] with exactly 4 divisors.
5
1, 7, 31, 67, 276, 239, 716, 483, 1332, 2928, 1304, 4835, 4169, 2383, 5422, 9894, 12254, 4609, 15755, 11914, 6579, 21594, 16245, 27245, 41927, 23681, 12546, 26291, 13890, 29282, 118588, 38805, 62617, 21974, 119076, 25737, 81339, 87301, 61503, 97603, 104448, 36207, 192806, 40916, 84479
OFFSET
1,2
EXAMPLE
a(1) = 1 because [1..7] contains 1 number 6 with exactly 4 divisors;
a(2) = 7 because [8..26] contains 7 numbers 8, 10, 14, 15, 21, 22, 26 with exactly 4 divisors;
a(3) = 31 because [27..124] contains 31 numbers 27, 33, 34, ..., 123 with exactly 4 divisors.
MATHEMATICA
a[1]=1; a[n_]/; n>1:=a[n]=Count[DivisorSigma[0, Range[Prime[n-1]^3, Prime[n]^3-1]], 4]; a/@Range[1, 45] (* Robert P. P. McKone, Apr 14 2026 *)
PROG
(Magma) [1] cat [#[k: k in [NthPrime(n-1)^3..NthPrime(n)^3-1] | #Divisors(k) eq 4]: n in [2..40]];
(Python)
from math import isqrt, comb
from sympy import primepi, primerange, prime
def A390951(n):
if n == 1: return 1
def f(x): return int(-(t:=primepi(s:=isqrt(p:=prime(x)**3)))-comb(t, 2)+sum(primepi(p//k) for k in primerange(2, s+1)))
return 1+f(n)-f(n-1) # Chai Wah Wu, Apr 20 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved