Macaulay2 » Documentation
Packages » Macaulay2Doc » elementary arithmetic » lcm
next | previous | forward | backward | up | index | toc

# lcm -- least common multiple

- Usage:
    `lcm(x,y,...)`
- Inputs:
  - x, a ring element, all the elements should be integers, rational numbers or ring elements
- Outputs:
  - m, a ring element, the least common multiple of the elements x,y,...

## Description

    i1 : lcm(-6,15,14)

    o1 = 210

    i2 : lcm(-6/7,15,14)

    o2 = 210

    o2 : QQ

    i3 : R = QQ[a..d];

    i4 : lcm(a^2-d^2,(a-d)*(b+c))

          2     2       2      2
    o4 = a b + a c - b*d  - c*d

    o4 : R

    i5 : factor oo

    o5 = (b + c)(a - d)(a + d)

    o5 : Expression of class Product

## See also

- gcd -- greatest common divisor

## Ways to use lcm:

- `lcm()`
- `lcm(List)`
- `lcm(QQ)`
- `lcm(QQ,QQ)`
- `lcm(QQ,ZZ)`
- `lcm(RingElement)`
- `lcm(RingElement,RingElement)`
- `lcm(RingElement,ZZ)`
- `lcm(Sequence)`
- `lcm(ZZ)`
- `lcm(ZZ,QQ)`
- `lcm(ZZ,RingElement)`
- `lcm(ZZ,ZZ)`
- lcm(MonomialIdeal) -- least common multiple of all minimal generators

## For the programmer

The object lcm is an associative binary method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/operators.m2:216:0.