TOPICS
Search

Almost Prime


A number n with prime factorization

 n=product_(i=1)^rp_i^(a_i)

is called k-almost prime if it has a sum of exponents sum_(i=1)^(r)a_i=k, i.e., when the prime factor (multiprimality) function Omega(n)=k.

The set of k-almost primes is denoted P_k.

The primes correspond to the "1-almost prime" numbers and the 2-almost prime numbers correspond to semiprimes. Conway et al. (2008) propose calling these numbers primes, biprimes, triprimes, and so on.

Formulas for the number of k-almost primes less than or equal to n are given by

 pi^((2))(n)=sum_(i=1)^(pi(n^(1/2)))[pi(n/(p_i))-i+1],
pi^((3))(n)=sum_(i=1)^(pi(n^(1/3)))sum_(j=i)^(pi((n/p_i)^(1/2)))[pi(n/(p_ip_j))-j+1],
pi^((4))(n)=sum_(i=1)^(pi(n^(1/4)))
 sum_(j=i)^(pi((n/p_i)^(1/3)))sum_(k=j)^(pi((n/(p_ip_j))^(1/2)))[pi(n/(p_ip_jp_k))-k+1],

and so on, where pi(x) is the prime counting function and p_k is the kth prime (R. G. Wilson V, pers. comm., Feb. 7, 2006; the first of which was discovered independently by E. Noel and G. Panos around Jan. 2005, pers. comm., Jun. 13, 2006).

The following table summarizes the first few k-almost primes for small k.

nOEISn-almost primes
1A0000402, 3, 5, 7, 11, 13, ...
2A0013584, 6, 9, 10, 14, 15, 21, 22, ...
3A0146128, 12, 18, 20, 27, 28, 30, 42, 44, 45, 50, 52, ...
4A01461316, 24, 36, 40, 54, 56, 60, 81, 84, 88, 90, 100, ...
5A01461432, 48, 72, 80, 108, 112, 120, 162, 168, 176, 180, ...

Let 1=u_1<u_2<... enumerate the positive integers with at most two prime factors, counted with multiplicity. The sequence consists of 1, the primes, and the semiprimes. It begins 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, ... (OEIS A037143). Erdős asked whether the supremum limit of (u_(k+1)-u_k)/logk is infinite. Eberwein (2026) proved the result by a short-translate construction. A separate proof found using GPT-6.2-sol and submitted by Lee (2026) was checked in Lean by the Palomar Registry.


See also

Chen's Theorem, Prime Factor, Prime Number, Semiprime, Sphenic Number

Explore with Wolfram|Alpha

References

Conway, J. H.; Dietrich, H.; O'Brien, E. A. "Counting Groups: Gnus, Moas, and Other Exotica." Math. Intell. 30, 6-18, 2008.Eberwein, L. "Erdős Problem #1139: An Alternative Proof via Short Translates." 15 Nov 2026. https://doi.org/10.5281/zenodo.24241059.Lee, B. "Erdős Problem 1139: Unbounded Gaps Between Integers with at Most Two Prime Factors." Palomar Registry, 24 Nov 2026. https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-24-000011&version=1.Numberphile. "A Breakthrough with Fingerprint Numbers." Featuring J. D. Lichtman. Oct. 10, 2023. https://www.youtube.com/watch?v=5lvLcwXU-MA&t=47s.Sloane, N. J. A. Sequences A000040/M0652, A001358/M3274, A014612, A014613, A014614, and A037143 in "The On-Line Encyclopedia of Integer Sequences."

Referenced on Wolfram|Alpha

Almost Prime

Cite this as:

Weisstein, Eric W. "Almost Prime." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/AlmostPrime.html

Subject classifications