September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,21 +0,0 @@
|
|||
def fac(n):
|
||||
step = lambda x: 1 + x*4 - (x/2)*2
|
||||
maxq = long(math.floor(math.sqrt(n)))
|
||||
d = 1
|
||||
q = n % 2 == 0 and 2 or 3
|
||||
while q <= maxq and n % q != 0:
|
||||
q = step(d)
|
||||
d += 1
|
||||
res = []
|
||||
if q <= maxq:
|
||||
res.extend(fac(n//q))
|
||||
res.extend(fac(q))
|
||||
else: res=[n]
|
||||
return res
|
||||
|
||||
if __name__ == '__main__':
|
||||
import time
|
||||
start = time.time()
|
||||
tocalc = 2**59-1
|
||||
print "%s = %s" % (tocalc, fac(tocalc))
|
||||
print "Needed %ss" % (time.time() - start)
|
||||
Loading…
Add table
Add a link
Reference in a new issue