Skip to content

Instantly share code, notes, and snippets.

@gavincangan
Created July 29, 2018 17:38
Show Gist options
  • Save gavincangan/6f9024fbe6fa5fa26258f5336ff4595e to your computer and use it in GitHub Desktop.
Save gavincangan/6f9024fbe6fa5fa26258f5336ff4595e to your computer and use it in GitHub Desktop.
import time
import math
def find_fact(num, cur_quot=[]):
ix = 3
if(num < 2):
return cur_quot
while(ix < math.sqrt(num)):
if(num % ix == 0):
cur_quot.append(ix)
# print(ix)
return find_fact(num/ix, cur_quot)
ix += 2
cur_quot.append(num)
num = 317584931803333
s = time.time()
cur_quot = []
while(num % 2 == 0):
cur_quot.append(2)
num /= 2
find_fact(num, cur_quot)
e = time.time()
print(cur_quot)
print(e-s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment