OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 24 as 196 = 14^2 = semiprime(5)^2, the 5th square in the 4-almost primes, is the 24th 4-almost prime.
MATHEMATICA
Position[Select[Range[3*10^4], PrimeOmega[#] == 4 &], _?(IntegerQ[Sqrt[#]] &)] // Flatten (* Amiram Eldar, Apr 13 2025 *)
PROG
(PARI) list(lim) = {my(f, c); for(k = 1, lim, f = factor(k); if(bigomega(f) == 4, c++; if(vecprod(f[, 2]) == 4, print1(c, ", ")))); } \\ Amiram Eldar, Apr 13 2025
(Python)
from math import isqrt, prod
from sympy import primerange, integer_nthroot, primepi
from oeis_sequences.OEISsequences import bisection
def A128303(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)))
def f(x): return int(n+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//p) for p in primerange(s+1)))
m = bisection(f, n, n)**2
return int(sum(primepi(m//prod(c[1] for c in a))-a[-1][0] for a in g(m, 0, 1, 1, 4))) # Chai Wah Wu, Jan 02 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Rick L. Shepherd, Mar 04 2007
STATUS
approved
