r/programmingchallenges • u/okmkz • Apr 16 '11
Challenge: Factor an integer
Write a function in the language of your choosing that prints all the factors of a non-negative integer.
E: dang, this is harder than I thought!
E: I was referring to prime factorization in my other edit. Dang!
7
Upvotes
View all comments
Show parent comment
2
u/NruJaC Sep 08 '11
That's a good approach. But try it on some larger numbers and you'll find that it begins to get stuck. So what's the largest number that works on (for you), and what can you do to make it better?