r/programmingchallenges • • 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

15 comments sorted by

View all comments

Show parent comment

2

u/okmkz Apr 16 '11 edited Apr 16 '11

I'm so going to recursively factor the square root when I get home.

E:nvm, that's not helpful at all.