Skip to content

Latest commit

 

History

History

prime_factors

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Prime Factors

Given a number, return only the factors that are prime. Use recursion

Function Signature

prime_factors(numer:Fixnum) -> [Fixnum]

Examples

prime_factors(25) -> [5,5]
prime_factors(123123123) -> [3, 3, 41, 333667]

Constraints

  • Use recursion
  • Faster than O(n)