one way to think about it: (defun count-chars1-1000 () (let* ((sum 0) (lst (loop for i from 1 to 1000 for num = (delete #\- (delete #\Space (format nil "~R" i))) collect num do (incf sum (length num))))) (print lst) sum))