Problem 4

(defun mirror-num (num)
  (let* ((str (int-to-string num))
	 (len (length str))
	 elt)
    (dotimes (i (floor (/ len 2)))
      (setq elt (aref str i))
      (aset str i (aref str (1- (- len i))))
      (aset str (1- (- len i)) elt))
    (string-to-int str) ))

(let ((i 1) (j 1) (rst 0) tmp)
  (while (< i 1000)
    (setq j 1)
    (while (< j 1000)
      (if (eq (* i j) (setq tmp (mirror-num (* i j))))
	  (if (< rst tmp)
	      (setq rst tmp) ))
      (setq j (1+ j)) )
    (setq i (1+ i)) )
  (princ rst)
  (princ "\n"))