Factors of a Mersenne number: Difference between revisions
m
→{{header|Mathematica}}
Thundergnat (talk | contribs) m (→{{header|Raku}}: modernize a bit, use built-ins) |
|||
Line 1,885:
</pre>
=={{header|Mathematica}}/{{header|Wolfram Language}}==
Believe it or not, this type of test runs faster in Mathematica than the squaring version described above.
<lang mathematica>For[i = 2, i < Prime[1000000], i = NextPrime[i],
If[Mod[2^44497, i] == 1,
Print["divisible by "<>i]]]; Print["prime test passed; call Lucas and Lehmer"]</lang>
|