Created
October 29, 2012 00:42
-
-
Save arn-e/3970721 to your computer and use it in GitHub Desktop.
prime_factorization_abridged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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