Skip to content

Commit 69f6c68

Browse files
committed
some enhancements
1 parent ec89465 commit 69f6c68

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dixon.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ def primes(B):
1515
start = isqrt(N)
1616
i = start
1717

18-
ii2N = []
18+
i2N = []
1919
while i<=N:
20-
ii2N.append((i,pow(i,2,N)))
20+
i2N.append(pow(i,2,N))
2121
i+=1
2222

2323
basej2N = []
2424
for j in range(0,len(base)):
2525
basej2N.append(pow(base[j],2,N))
2626

27-
for i,i2N in ii2N:
27+
for i in range(0,len(i2N)):
2828
for k in range(0,len(base)):
29-
if i2N == basej2N[k]:
30-
f=gcd(i-base[k],N)
29+
if i2N[i] == basej2N[k]:
30+
f=gcd(start + i - base[k],N)
3131
if 1 < f < N:
3232
return f,N//f
3333
return -1

0 commit comments

Comments
 (0)