Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
MillerRabin[n_,k_]:=Module[{d=n-1,s=0,test=True},While[Mod[d,2]==0 ,d/=2 ;s++]
|
||||
Do[
|
||||
a=RandomInteger[{2,n-1}]; x=PowerMod[a,d,n];
|
||||
If[x!=1,
|
||||
For[ r = 0, r < s, r++, If[x==n-1, Continue[]]; x = Mod[x*x, n]; ];
|
||||
If[ x != n-1, test=False ];
|
||||
];
|
||||
,{k}];
|
||||
Print[test] ]
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
MillerRabin[17388,10]
|
||||
->False
|
||||
Loading…
Add table
Add a link
Reference in a new issue