Problem 5 in Lisp