-
Notifications
You must be signed in to change notification settings - Fork 0
/
POLPM1.8xp
97 lines (92 loc) · 1.43 KB
/
POLPM1.8xp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
If F≠π
Then
0→Y:0→X
0→Ymin:0→Xmin
265→Ymax:164→Xmax:9→Yscl:15→Xscl
TextColor(BLUE)
Disp "N=pq, factor w/A"
Prompt N,A
ClrDraw
DispGraph
Text(X,Y,"let an=")
Y+6*Yscl→Y
A→V
prgmZOUTNUM
Text(X,Y,"^(n!) mod ")
Y+8*Yscl→Y
N→V
prgmZOUTNUM
Yscl→Y
X+Xscl→X
Text(X,Y,">gcd(a_n-1,")
Y+10*Yscl→Y
N→V
prgmZOUTNUM
Text(X,Y,")")
0→Y
X+Xscl→X
Text(X,Y,"a0=")
Y+3*Yscl→Y
A→V
prgmZOUTNUM
0→Y
X+Xscl→X
End
1→J
While 1
Text(X,Y,"a")
Y+Yscl→Y
J→V
prgmZOUTNUM
Text(X,Y,"=")
Y+Yscl→Y
π→S
π→F
A→G
J→A
prgmFASTPOW
TextColor(BLUE)
R→A
0→S
0→F
A→V
prgmZOUTNUM
Y+Yscl→Y
Text(X,Y,"(")
Y+Yscl→Y
N→V
prgmZOUTNUM
Text(X,Y,") >")
0→Y
X+Xscl→X
Text(X,Y,"gcd(")
Y+4*Yscl→Y
A-1→V
prgmZOUTNUM
Text(X,Y,",N)=")
Y+4*Yscl→Y
gcd(A-1,N)→V
If V=1 or V=N
Then
TextColor(RED)
prgmZOUTNUM
Else
TextColor(GREEN)
prgmZOUTNUM
0→Y
X+Xscl→X
Text(X,Y,"N=pq=")
Y+5*Yscl→Y
prgmZOUTNUM
Text(X,Y,"*")
Y+Yscl→Y
V→R
N/V→V
prgmZOUTNUM
Return
End
TextColor(BLUE)
1+J→J
0→Y
X+Xscl→X
End