;;;
;;; Check if a number is a nude number.
;;; Number n is nude if its evenly divisible by each of its digits.
;;;
;;; @creator gdt
;;; @created 02016.11.16
;;; @see https://oeis.org/A034838
;;;
(defun nude (n)
(let ((ndigits (1+ (floor (log n 10)))) (d 0) (m n))
(dotimes (i ndigits)
(setf d (mod m 10))
(format t "d is ~d~%" d)
(setf m (floor (/ m 10)))
(format t "m is ~d~%" m)
(if (zerop m) (return t))
(if (/= (rem n d) 0) (return nil)))))