t3x.org / sketchy / library / lcm.html
SketchyLISP
Reference
  Copyright (C) 2006
Nils M Holm

lcm

Conformance: R5RS

Purpose: Compute the least common multiple (LCM) of two integer numbers.

Arguments:
A - number
B - number

Implementation:

(define (lcm . a)
  (letrec
    ((_lcm (lambda (a b)
      (let ((cd (gcd a b)))
        (n* cd (n* (nquotient a cd)
                   (nquotient b cd)))))))
      (reduce _lcm
        (map (lambda (x)
              (natural (abs x)))
          a)
        1)))

Example:

(lcm 32 -36) 
=> 288

See also:
digits, expt, gcd.