LCM
✖
LCM
Details

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

Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (11)Survey of the scope of standard use cases
Numerical Evaluation (7)
LCM works over integers:

https://wolfram.com/xid/02cx6-fgai5c


https://wolfram.com/xid/02cx6-cmctw6


https://wolfram.com/xid/02cx6-hka5t4


https://wolfram.com/xid/02cx6-hbja6m

The one-argument form is identity for positive integers:

https://wolfram.com/xid/02cx6-e8sr93


https://wolfram.com/xid/02cx6-me32zh

LCM threads elementwise over lists:

https://wolfram.com/xid/02cx6-g7y05f

Symbolic Manipulation (4)
TraditionalForm formatting:

https://wolfram.com/xid/02cx6-dey62h


https://wolfram.com/xid/02cx6-kgta6s


https://wolfram.com/xid/02cx6-qg8p4k


https://wolfram.com/xid/02cx6-xrggl4


https://wolfram.com/xid/02cx6-y7h28z

Applications (9)Sample problems that can be solved with this function
Basic Applications (4)
Table of the LCMs of the first 100 pairs of integers:

https://wolfram.com/xid/02cx6-kzlod6

Visualize the LCMs of two integers:

https://wolfram.com/xid/02cx6-wipe5


https://wolfram.com/xid/02cx6-nbtmnk

The LCM of the first 100 integers:

https://wolfram.com/xid/02cx6-hcxlz

Compute LCM for positive integers:

https://wolfram.com/xid/02cx6-f5sa2v

https://wolfram.com/xid/02cx6-hc12m


https://wolfram.com/xid/02cx6-h1anbe

Number Theory (5)

https://wolfram.com/xid/02cx6-zf9asi

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

https://wolfram.com/xid/02cx6-lidfix

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

https://wolfram.com/xid/02cx6-89poab


https://wolfram.com/xid/02cx6-6orsme

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

https://wolfram.com/xid/02cx6

LCMs of binomial coefficients:

https://wolfram.com/xid/02cx6

Compare with:

https://wolfram.com/xid/02cx6

Simplify expressions containing LCM:

https://wolfram.com/xid/02cx6-bxhmfw


https://wolfram.com/xid/02cx6-5elzc4


https://wolfram.com/xid/02cx6-7j66kw

Properties & Relations (7)Properties of the function, and connections to other functions
Every divisor of a and b is a divisor of :

https://wolfram.com/xid/02cx6-hu64el


https://wolfram.com/xid/02cx6-f2xcc7


https://wolfram.com/xid/02cx6-emhzf3

The LCM of coprime numbers is equal to their product:

https://wolfram.com/xid/02cx6-yea5ne


https://wolfram.com/xid/02cx6-bxw2rg

LCM for prime numbers is their product:

https://wolfram.com/xid/02cx6-c11ruk


https://wolfram.com/xid/02cx6-b6ga13

LCM for prime power representation :

https://wolfram.com/xid/02cx6-kbwtft

https://wolfram.com/xid/02cx6-d2nf8

LCM is commutative :

https://wolfram.com/xid/02cx6-1b13cp

LCM is associative :

https://wolfram.com/xid/02cx6-4xyiz3

LCM is distributive :

https://wolfram.com/xid/02cx6-j40va9

Use LCM to compute MangoldtLambda:

https://wolfram.com/xid/02cx6-htptxl


https://wolfram.com/xid/02cx6-u8c3yh

Possible Issues (3)Common pitfalls and unexpected behavior

https://wolfram.com/xid/02cx6-kc9x8g

The arguments must be explicit integers:

https://wolfram.com/xid/02cx6-bksbzi


LCM sorts its arguments:

https://wolfram.com/xid/02cx6-0v6xu3

Interactive Examples (1)Examples with interactive outputs
Neat Examples (4)Surprising or curious use cases
Visualize the LCMs of Fibonacci numbers:

https://wolfram.com/xid/02cx6-e7s0yr

Plot the arguments of the Fourier transform of the LCM:

https://wolfram.com/xid/02cx6-hw26ik

Plot the Ulam spiral of the LCM:

https://wolfram.com/xid/02cx6-5mjdwo

https://wolfram.com/xid/02cx6-hx9nbv

Form the LCMs of with rational numbers:

https://wolfram.com/xid/02cx6

Wolfram Research (1988), LCM, Wolfram Language function, https://reference.wolfram.com/language/ref/LCM.html (updated 1999).
Text
Wolfram Research (1988), LCM, Wolfram Language function, https://reference.wolfram.com/language/ref/LCM.html (updated 1999).
Wolfram Research (1988), LCM, Wolfram Language function, https://reference.wolfram.com/language/ref/LCM.html (updated 1999).
CMS
Wolfram Language. 1988. "LCM." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1999. https://reference.wolfram.com/language/ref/LCM.html.
Wolfram Language. 1988. "LCM." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1999. https://reference.wolfram.com/language/ref/LCM.html.
APA
Wolfram Language. (1988). LCM. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LCM.html
Wolfram Language. (1988). LCM. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LCM.html
BibTeX
@misc{reference.wolfram_2025_lcm, author="Wolfram Research", title="{LCM}", year="1999", howpublished="\url{https://reference.wolfram.com/language/ref/LCM.html}", note=[Accessed: 23-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_lcm, organization={Wolfram Research}, title={LCM}, year={1999}, url={https://reference.wolfram.com/language/ref/LCM.html}, note=[Accessed: 23-March-2025
]}