Commits

Yuriy Netesov committed 16d766c

euler 3 solution

  • Participants
  • Parent commits f35ee6b

Comments (0)

Files changed (1)

File euler_3.lisp

+(defun divider-p (num pretender)
+  (eq (rem num pretender) 0))
+
+(defun get-largest-prime (numb &key (lmax 1))
+  (loop for i from 2 to numb do 
+	   (when (divider-p numb i)
+		 (return-from get-largest-prime 
+		   (get-largest-prime (round (/ numb i)) :lmax (max lmax i)))))
+  lmax)
+
+(defun solve ()
+  (get-largest-prime 600851475143))