Wagstaff primes: Difference between revisions
add RPL
(add RPL) |
|||
Line 1,177:
^C</pre>
===RPL 2003 version===
≪ { } 2
'''WHILE''' OVER SIZE 10 < '''REPEAT'''
NEXTPRIME
2 OVER ^ 1 + 3 /
'''IF''' DUP ISPRIME? '''THEN'''
OVER →STR ":" + SWAP + ROT SWAP + SWAP
'''ELSE''' DROP '''END'''
'''END''' DROP
≫ '<span style="color:blue">WAGSTAFF</span>' STO
{{out}}
<pre>
1: { "3:3" "5:11" "7:43" "11:683" "13:2731" "17:43691" "19:174763" "23:2796203" "31:715827883" "43:2932031007403" }
</pre>
=={{header|Ruby}}==
For the first 12 the Ruby prime library is sufficiently fast. Here, the external GMP gem is used in order to do more.
|