Skip to content

Instantly share code, notes, and snippets.

@arn-e
Created October 29, 2012 00:42
Show Gist options
  • Save arn-e/3970721 to your computer and use it in GitHub Desktop.
Save arn-e/3970721 to your computer and use it in GitHub Desktop.
prime_factorization_abridged
def pf(n,a=[],f=2)
n==f ?a<<f:n%f==0?pf(n/f,a<<f):pf(n,a,f+1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment