Prime Factor

DOWNLOAD Mathematica Notebook EXPLORE THIS TOPIC IN the MathWorld Classroom Contribute to this entry

A prime factor is a factor that is prime, i.e., one that cannot itself be factored. In general, a prime factorization takes the form

 n=p_1^(alpha_1)p_2^(alpha_2)...p_k^(alpha_k),
(1)

where p_i are prime factors and alpha_i are their orders. Prime factorization can be performed in the Wolfram Language using the command FactorInteger[n], which returns a list of (p_i,alpha_i) pairs.

The following table gives the prime factorization for the positive integers <=50.

111111213·731314141
22122^2·3222·11322^5422·3·7
3313132323333·114343
42^2142·7242^3·3342·17442^2·11
55153·5255^2355·7453^2·5
62·3162^4262·13362^2·3^2462·23
771717273^337374747
82^3182·3^2282^2·7382·19482^4·3
93^219192929393·13497^2
102·5202^2·5302·3·5402^3·5502·5^2
PrimeFactors

The number of not necessarily distinct prime factors of a number n is denoted Omega(n) (Hardy and Wright 1979, p. 354) or r(n). Conway et al. (2008) coined the term "multiprimality of n" to describe Omega(n), with semiprimes then being termed biprimes, numbers with three factors terms triprimes, etc. The number of prime factors is given in terms of the prime factorization above by

 Omega(n)=sum_(i=1)^kalpha_i.
(2)

The first few values for n=1, 2, ... are 0, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 2, 2, 4, 1, 3, 1, 3, ... (OEIS A001222). Omega(n) is plotted above up to n=100 (left) and n=1000 (right). The function Omega(n) is implemented in the Wolfram Language as PrimeOmega[n],

The function defined by lambda(n)=(-1)^(Omega(n)) is known as the Liouville function.

The number of distinct prime factors of a number n is denoted omega(n) (Hardy and Wright 1979, p. 354), or sometimes nu(n) or r(n), and is implemented in the Wolfram Language as PrimeNu[n].

For example, 4=2·2 has a single distinct prime factor, so omega(4)=1, but two total prime factors, so Omega(4)=2.

An asymptotic series for Omega(n) is given by

 Omega(n)∼lnlnn+B_2+sum_(k=1)^infty(-1+sum_(j=0)^(k-1)(gamma_j)/(j!))((k-1)!)/((lnn)^k)
(3)

(Diaconis 1976, Knuth 2000, Diaconis 2002, Finch 2003, Knuth 2003), where B_2 is a constant related to the Mertens constant and gamma_j are Stieltjes constants. Furthermore, the variance is given by

 var(Omega(n))∼lnlnn+B_2^'+(c_1)/(lnn)+(c_2)/((lnn)^2)+...,
(4)

where

B_2^'=B_2-T-1/6pi^2
(5)
=0.76478...
(6)

(OEIS A091589), and

 T=sum_(k=1)^infty1/((p_k-1)^2) approx 1.37506...
(7)

(OEIS A086242; Finch 2003) is a convergent prime sum. The coefficients c_1 and c_2 are given by the sums

c_1=gamma-1-2sum_(k=1)^(infty)(lnp_k)/((p_k-1)^2)
(8)
=gamma-1+2sum_(k=2)^(infty)phi(k)(zeta^'(k))/(zeta(k))
(9)
=2.8767219464...
(10)
c_2=-gamma_1-(gamma-1)[gamma-2sum_(k=1)^(infty)(lnp_k)/((p_k-1)^2)]-2sum_(k=1)^(infty)(p_k(lnp_k)^2)/((p_k-1)^3)
(11)
=4.9035933594...
(12)

(Diaconis 1976, Knuth 2000, Diaconis 2002, Finch 2003, Knuth 2003), where

U=sum_(k=1)^(infty)(lnp_k)/((p_k-1)^2)
(13)
=1.2269688...
(14)
V=sum_(k=1)^(infty)(p_k(lnp_k)^2)/((p_k-1)^3)
(15)
=2.0914802...
(16)

(Finch 2003).

Similarly, if n is chosen at random between 1 and x, then the probability that

 Omega(n)<=lnlnn+csqrt(lnlnx)
(17)

approaches

 1/(sqrt(2pi))int_(-infty)^ce^(-u^2/2)du
(18)

as x->infty (Knuth 1998, p. 384). In addition, the average value t^_ of Omega(n)-lnlnx for 1<=n<=x approaches B_2 (Erdős and Kac 1940; Hardy and Wright 1979; Knuth 1998, p. 384)

PrimeFactorsAverageOrder

The average order of Omega(n) is

 Omega(n)∼lnlnn
(19)

(Hardy 1999, p. 51). More precisely,

 sum_(n<=x)Omega(n)=xlnlnx+Bx+O(x/(lnx)),
(20)

for appropriate constants A and B (Hardy and Ramanujan 1917; Hardy and Wright 1979, p. 355; Hardy 1999, p. 57), where O(x) is asymptotic notation.

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.