We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec89465 commit 69f6c68Copy full SHA for 69f6c68
dixon.py
@@ -15,19 +15,19 @@ def primes(B):
15
start = isqrt(N)
16
i = start
17
18
- ii2N = []
+ i2N = []
19
while i<=N:
20
- ii2N.append((i,pow(i,2,N)))
+ i2N.append(pow(i,2,N))
21
i+=1
22
23
basej2N = []
24
for j in range(0,len(base)):
25
basej2N.append(pow(base[j],2,N))
26
27
- for i,i2N in ii2N:
+ for i in range(0,len(i2N)):
28
for k in range(0,len(base)):
29
- if i2N == basej2N[k]:
30
- f=gcd(i-base[k],N)
+ if i2N[i] == basej2N[k]:
+ f=gcd(start + i - base[k],N)
31
if 1 < f < N:
32
return f,N//f
33
return -1
0 commit comments