Skip to main content

Least common multiple (lcm)

Nota

Working with polynomials? See Least common multiple (Polynomials).

Returns the least common multiple of a set of integers.

Syntax

lcm(Integer, ..., Integer)
lcm(List)
lcm(Vector)
lcm(Fraction, Fraction)

Description

Given a set of integers a1, ...,an , returns the least number that is a multiple of a1a_1, ...,ana_n simultaneously.

arithmetic.lcm1.calc.png

Given a list of integers {a1,...,an} , returns the least number that is a multiple of a1a_1, ...,ana_n simultaneously.

arithmetic.lcm2.calc.png

Given a vector of integers [a1,...,an] , returns the least number that is a multiple of a1a_1, ...,ana_n simultaneously.

arithmetic.lcm3.calc.png

Given two fractions ab and cd, returns its least common multiple defined as lcmab,cd=lcm(a,c)gcd(b,d)

arithmetic.lcm4.calc.png