Almost Prime

DOWNLOAD Mathematica Notebook

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, ...

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.