(defun premier(nombre)
(setq divisor 2)
(setq firstdivisor 0)
(if (eq (% nombre divisor) 0)
    (setq firstdivisor 2 divisor nombre)
  (setq divisor 3))
(while (<= ( * divisor divisor) nombre )
  (if (eq (% nombre divisor) 0 )
      (setq firstdivisor divisor divisor nombre)
    (setq divisor (+ 2 divisor))))
(if (eq firstdivisor 0)
    (message "The number %d is prime " nombre)
  (message "The number %d is a multiple of  %d " nombre firstdivisor))
)

(premier 2017)