Problem 41 in lisp