Skip to content

Instantly share code, notes, and snippets.

@popey456963
Created November 17, 2015 11:18
Show Gist options
  • Save popey456963/c19304272f838719c996 to your computer and use it in GitHub Desktop.
Save popey456963/c19304272f838719c996 to your computer and use it in GitHub Desktop.
primes
import math
def factors(number):
return [(x, number / x) for x in range(int(math.sqrt(number)))[2:] if not number % x]
import time
start_time = time.time()
print(factors(543340953458958439))
print("--- %s seconds ---" % (time.time() - start_time))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment