Basic Examples (2)
Basic Examples
(2)
A certificate that can be used to prove that is a prime:
1093
In[6]:=
Out[6]=
{1093,5,{2,{3,2,{2}},{7,3,{2,{3,2,{2}}}},{13,2,{2,{3,2,{2}}}}}}
In[21]:=
ResourceFunction["ProvablePrimeQ"][1093,"Certificate"->True]
Out[21]=
{True,{1093,5,{2,{3,2,{2}},{7,3,{2,{3,2,{2}}}},{13,2,{2,{3,2,{2}}}}}}}
———
A certificate that can be used to prove that is composite:
1093×3511
In[1]:=
Out[1]=
{2,3837522,3837523}
The output is a list of three integers that indicate is composite, and that it violates Fermat's little theorem for primes, ≡1modp if is prime:
1093×3511
p-1
2
p
In[2]:=
PowerMod@@%
Out[2]=
3134697