Lucas-Lehmer test: Difference between revisions

→‎{{header|langur}}: added output and notes
m (→‎{{header|langur}}: change where() to filter())
(→‎{{header|langur}}: added output and notes)
Line 2,068:
{{trans|D}}
{{works with|langur|0.11}}
I suppose it is theoretically possible to test to the 47th Mersenne prime, as stated in the task description, though it could take a while. As for the limit, it would be very high.
With slight syntactic differences, this would also work with earlier versions of langur if you limit it to smaller numbers. 0.8 uses arbitrary precision.
 
With slight syntactic differences, thisthe wouldfollowing alsowould work with earlier versions of langur if you limit it to smaller numbers. 0.8 usesswitched to arbitrary precision.
 
<syntaxhighlight lang="langur">val .isPrime = f .i == 2 or
Line 2,084 ⟶ 2,086:
 
writeln join " ", map f $"M\.x;", filter .isMersennePrime, series 2300</syntaxhighlight>
 
{{out}}
<pre>M2 M3 M5 M7 M13 M17 M19 M31 M61 M89 M107 M127 M521 M607 M1279 M2203 M2281
</pre>
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
885

edits