: underwhelming? What were you expecting? Errors on the 7 page are not
: acceptable. /weird /dying fore'um
I thought you were presenting the information for the first time, and I didn't spot the error until just now. My mistake. I'm too used to being hostile. ;P
Hamish isn't perfect, sadly; good thing the pattern holds anyway and the original poster was correct. :)
For your own print-out, throw this in your favorite Common Lisp interpreter. Modify the bound of the loop on the last line (it's 13 right now) to get more or fewer numbers (note that this is ugly because it's tail recursive, which lets you bring up the list bound pretty stunningly high without any memory issues):
(defun pow (base exp) (labels ((po (base exp acc) (if (zerop exp) acc (po base (1- exp) (* acc base))))) (po base exp 1)))
(defun collapse (n) (labels ((coll (n) (labels ((col (n acc) (if (zerop n) acc (col (truncate (/ n 10)) (+ acc (mod n 10)))))) (col n 0)))) (let ((i (coll n))) (if (< i 10) i (collapse i)))))
(dotimes (i 13) (format t "7 to the power of ~d = ~d which reduces to ~d~%" i (truncate (pow 7 i)) (collapse (truncate (pow 7 i)))))