Last active
December 16, 2015 00:10
-
-
Save bitdewy/5345930 to your computer and use it in GitHub Desktop.
Project Euler #3 in Common Lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; | |
;;;; 3.lisp | |
;;;; ProjectEuler | |
;;;; | |
;;;; Created by bitdewy on 4/9/13. | |
;;;; Copyright (c) 2013 bitdewy. All rights reserved. | |
;;;; | |
;; Project Euler #3 | |
(defun factorization (number) | |
(do ((sequence nil) (max (isqrt number)) (i 2 (+ 1 i))) | |
((or (> i number) (> i max)) sequence) | |
(do () | |
((< 0 (mod number i)) sequence) | |
(setf number (/ number i)) | |
(push i sequence)))) | |
(first (factorization 600851475143)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment