Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Giacomo Ritucci
committed
Jul 15, 2008
1 parent
f734843
commit e0f94a3
Showing
1 changed file
with
8 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
;;;; Giacomo Ritucci, 23.07 di venerdì 14 dicembre 2007 | ||
;;;; Giacomo Ritucci, 02.03 di martedì 15 luglio 2008 | ||
|
||
;;; Problem 3 | ||
;;; | ||
;;; The prime factors of 13195 are 5, 7, 13 and 29. | ||
;;; | ||
;;; What is the largest prime factor of the number 317584931803? | ||
|
||
(defun largest-prime-factor (n &optional (i 2)) | ||
(cond ((= n i) n) | ||
((= 0 (mod n i)) (largest-prime-factor (/ n i) i)) | ||
(T (largest-prime-factor n (incf i))))) | ||
|
||
(largest-prime-factor 600851475143) |