gives the least common multiple of the ni.


  • LCM is also known as smallest common multiple.
  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • LCM[n1,n2,] is the smallest positive integer that is a multiple of each of the integers n1,n2,.
  • For rational numbers ri, LCM[r1,r2,] gives the least rational number r for which all the r/ri are integers.
  • LCM works over Gaussian integers.


open allclose all

Basic Examples  (2)

Find the least common multiple of a set of numbers:

Plot the least common multiple for a number with :

Scope  (11)

Numerical Evaluation  (7)

LCM works over integers:

Gaussian integers:

Real rational numbers:

Complex rational numbers:

The one-argument form is identity for positive integers:

Compute for large integers:

LCM threads elementwise over lists:

Symbolic Manipulation  (4)

TraditionalForm formatting:

Reduce inequalities:

Solve equations:

Simplify expressions:

Applications  (9)

Basic Applications  (4)

Table of the LCMs of the first 100 pairs of integers:

Visualize the LCMs of two integers:

Fibonacci numbers:

The LCM of the first 100 integers:

Compute LCM for positive integers:

Compare with:

Number Theory  (5)

Cumulative LCMs:

Plot the logarithm of the data (if Riemann's hypothesis holds, this grows linearly):

The sum of MangoldtLambda of the first n integers is equal to the natural log of the LCM of the first n integers:

Maximal order of group elements from the symmetric group of order n (Landau's function):

LCMs of binomial coefficients:

Compare with:

Simplify expressions containing LCM:

Properties & Relations  (7)

Every divisor of a and b is a divisor of :

Use GCD to compute LCM:

Compare with:

The LCM of coprime numbers is equal to their product:

LCM for prime numbers is their product:

LCM for prime power representation :

LCM is commutative :

LCM is associative :

LCM is distributive :

Use LCM to compute MangoldtLambda:

Compare with:

Possible Issues  (3)

Signs are discarded:

The arguments must be explicit integers:

LCM sorts its arguments:

Interactive Examples  (1)

Visualize the LCMs of three numbers:

Neat Examples  (4)

Visualize the LCMs of Fibonacci numbers:

Plot the arguments of the Fourier transform of the LCM:

Plot the Ulam spiral of the LCM:

Form the LCMs of with rational numbers:

Wolfram Research (1988), LCM, Wolfram Language function, (updated 1999).


Wolfram Research (1988), LCM, Wolfram Language function, (updated 1999).


Wolfram Language. 1988. "LCM." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1999.


Wolfram Language. (1988). LCM. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_lcm, author="Wolfram Research", title="{LCM}", year="1999", howpublished="\url{}", note=[Accessed: 23-June-2024 ]}


@online{reference.wolfram_2024_lcm, organization={Wolfram Research}, title={LCM}, year={1999}, url={}, note=[Accessed: 23-June-2024 ]}