OFFSET
1,2
COMMENTS
the primepi function might be used to find terms. But it is expensive for larger numbers so then one might use A335331 to ease finding primepi(m) for larger m. - David A. Corneth, Apr 13 2025
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..590
David A. Corneth, PARI program
EXAMPLE
a(4) = 82 as 343 = 7^3 = prime(4)^3, the fourth cube in the 3-almost primes, is the eighty-second 3-almost prime.
MATHEMATICA
Position[Select[Range[10^6], PrimeOmega[#] == 3 &], _?(PrimeNu[#] == 1 &)] // Flatten (* Amiram Eldar, Apr 13 2025 *)
PROG
(PARI) list(lim) = {my(f, c); for(k = 1, lim, f = factor(k); if(bigomega(f) == 3, c++; if(omega(f) == 1, print1(c, ", ")))); } \\ Amiram Eldar, Apr 13 2025
(PARI) \\ See Corneth link
(Python)
from math import isqrt, prod
from sympy import primerange, integer_nthroot, primepi, prime
def A128302(n):
def g(x, a, b, c, m): yield from (((d, ) for d in enumerate(primerange(b, isqrt(x//c)+1), a)) if m==2 else (((a2, b2), )+d for a2, b2 in enumerate(primerange(b, integer_nthroot(x//c, m)[0]+1), a) for d in g(x, a2, b2, c*b2, m-1)))
m = prime(n)**3
return int(sum(primepi(m//prod(c[1] for c in a))-a[-1][0] for a in g(m, 0, 1, 1, 3))) # Chai Wah Wu, Jan 02 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Rick L. Shepherd, Feb 25 2007
STATUS
approved
