The question i\'m trying to answer:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
Where am I goin
Easy answer:
$ factor 600851475143
600851475143: 71 839 1471 6857
More serious answer: Your prime?
function is indeed broken; I'm not even certain what it's trying to do. (Also, your (= n 2)
test is too late to be useful: the (even? n)
test has trumped it.)
My suggestion: Implement the Sieve of Eratosthenes. Here's my implementation.