up previous next
lcm    --    least common multiple


Syntax
lcm(M: INT, N: INT): INT
lcm(L: LIST of INT): INT

lcm(F: RINGELEM, G: RINGELEM): RINGELEM
lcm(L: LIST of RINGELEM): RINGELEM

Description
This function returns the least common multiple of its arguments, or of the elements in the list L. For the calculation of the GCDs and LCMs of polynomials, the coefficient ring must be a field.

Example
/**/  use R ::= QQ[x,y];
/**/  F := x^2-y^2;
/**/  G := (x+y)^3;
/**/  lcm(F, G);
x^4 +2*x^3*y -2*x*y^3 -y^4

/**/  IsDivisible(F*G, It);
true

/**/  lcm(F, G) * gcd(F,G) = F*G;
true

/**/  lcm([3*4,3*8,6*16]);
96

See Also