;;;Calculate Euler's totient function phi(m).
;;Euler's so-called totient function phi(m) is defined as the number of positive integers r (1 <= r < m) that are coprime to m.
(load "p33.lisp")
(defun phi(m)
(let ((np 0))
(do ((i 1 (+ i 1)))
((> i m) np)
(if (coprime i m)
(incf np)))))
(format t "~%PHI(~a) is ~a " 11 (phi 11))