Mersenne primes: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
Line 1,662: Line 1,662:
^C
^C
sidef mersenne.sf 12.47s user 0.02s system 99% cpu 12.495 total
sidef mersenne.sf 12.47s user 0.02s system 99% cpu 12.495 total
</pre>

=={{header|Transd}}==
<syntaxhighlight lang="Scheme">#lang transd

MainModule: {
_start: (λ locals: curexp 1 maxexp 1000 base BigLong(2)
(while (< curexp maxexp)
(+= curexp 1)
(if (not (is-prime BigLong(curexp))) continue)
(with cand (- (pow base curexp) 1)
(if (is-probable-prime cand 10)
(lout curexp " : " cand ))
) ) )
}</syntaxhighlight>
{{out}}
<pre>
2 : 3
3 : 7
5 : 31
7 : 127
13 : 8191
17 : 131071
19 : 524287
31 : 2147483647
61 : 2305843009213693951
89 : 618970019642690137449562111
107 : 162259276829213363391578010288127
127 : 170141183460469231731687303715884105727
521 : 6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151
607 : 531137992816767098689588206552468627329593117727031923199444138200403559860852242739162502265229285668889329486246501015346579337652707239409519978766587351943831270835393219031728127

</pre>
</pre>