lcm: Computes the least common multiple of two integers, a and b.

Description Usage Arguments Value Examples

Description

The least common multiple is defined as the smallest possible positive integer that is divisible by both a and b, and is usually denoted lcm(a,b) or LCM(a,b). The function implementation for finding the least common multiple takes advantage of the relation between the greatest common divisor and the least common multiple, such that:

lcm(a,b) = \bigg(\frac{|a|}{gcd(a,b)} \bigg) \space |b|

Usage

1
lcm(a, b)

Arguments

a

First integer

b

Second integer

Value

the least common multiple of the two given integers

Examples

1
2
lcm(21, 6)
lcm(15, 3)

aschleg/numberr documentation built on May 14, 2019, 10:31 a.m.