Repunit primes: Difference between revisions

add RPL
(New post.)
(add RPL)
Line 644:
Base 35: 313 1297
Base 36: 2</pre>
=={{header|RPL}}==
{{works with|HP|49}}
≪ 0 1 4 ROLL '''START''' OVER * 1 + '''NEXT''' NIP
≫ '<span style="color:blue">REPUB</span>' STO @ ( n b → Rb(n) )
≪ 16 2 '''FOR''' b
{ }
2 1000 '''FOR''' n
'''IF''' n b REPUB ISPRIME? '''THEN''' n + '''END'''
'''NEXT'''
-1 '''STEP'''
"Done."
≫ '<span style="color:blue">TASK</span>' STO
{{out}}
<pre>
16: {2}
15: {3 43 73 487}
14: {3 7 19 31 41}
13: {5 7 137 283 883 991}
12: {2 3 5 19 97 109 317 353 701}
11: {17 19 73 139 907}
10: {2 19 23 317}
9: { }
8: {3}
7: {5 13 131 149}
6: {2 3 7 29 71 127 271 509}
5: {3 7 11 13 47 127 149 181 619 929}
4: {2}
3: {3 7 13 71 103 541}
2: {2 3 5 7 13 17 19 31 61 89 107 127 521 607}
1: "Done."
</pre>
 
=={{header|Ruby}}==
Ruby's standard lib 'Prime' is boring slow for this. GMP to the rescue. GMP bindings is a gem, not in std lib.
Line 671 ⟶ 704:
Base 16: 2
</pre>
 
=={{header|Scheme}}==
{{works with|Chez Scheme}}
1,150

edits