up previous next
lcm

least common multiple

Syntax
lcm(N:INT, M: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 F_1,...,F_n 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