Last active
December 17, 2015 12:19
Revisions
-
iepathos revised this gist
May 20, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ from math import sqrt """ Fast factorization algorithm. Uses tuples instead of lists and sqrt over exponentiation. """ def factors(n): return set(x for tup in ([i, n//i] -
iepathos revised this gist
May 20, 2013 . 1 changed file with 1 addition and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,7 @@ from math import sqrt """ Fast factorization algorithm. Uses tuples instead of lists and sqrt over exponentiation. """ def factors(n): -
iepathos revised this gist
May 20, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ ### FIND FACTORS """ Fastest factorization algorithm. Uses tuples instead of lists and sqrt over exponentiation. """ def factors(n): return set(x for tup in ([i, n//i] -
iepathos renamed this gist
May 20, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
iepathos revised this gist
May 19, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ ### FIND FACTORS """ Fastest factorization algorithm. Uses tuples instead of lists and sqrt imported to the namespace over exponentiation. """ def factors(n): -
iepathos created this gist
May 19, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- from math import sqrt ### FIND FACTORS """ Fastest factorization algorithm? Uses tuples instead of lists and sqrt imported to the namespace over exponentiation. """ def factors(n): return set(x for tup in ([i, n//i] for i in range(1, int(sqrt(n))+1) if n % i == 0) for x in tup)