August 19, 2024

P33 - Determine whether two positive integer numbers are coprime

Two numbers are coprime if their greatest common divisor equals 1.

Example:* (coprime 35 64)T

lisp

(load "p32.lisp")

(defun coprime (n m)
  (if (= 1 (my-gcd n m))
      t
    nil
    )
  )
Be first to comment
Leave a reply