login
A128303
Indices of squares (of semiprimes) in the 4-almost primes.
3
1, 3, 8, 12, 24, 29, 59, 66, 90, 97, 162, 172, 187, 224, 234, 335, 385, 412, 489, 531, 551, 630, 692, 791, 921, 997, 1128, 1223, 1256, 1285, 1420, 1484, 1518, 1549, 1937, 2146, 2315, 2441, 2483, 2556, 2606, 2651, 2915, 3124, 3175, 3542, 3587, 3645, 3751, 3800
OFFSET
1,2
LINKS
FORMULA
A014613(a(n)) = A074985(n) = A001358(n)^2.
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