Update factor.rb

I like your solution to the prime factors.  Elegant.  But could be made faster and using tail call.
Merge pull request #4 from 404pnf/patch-2

More solutions to get the prime factors of a number