Primes: n*2^m+1: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (Remove draft tag. Draft for over a year, multiple implementations, little controversy) |
(added RPL) |
||
Line 2,595: | Line 2,595: | ||
399 2: 1597 |
399 2: 1597 |
||
400 0: 401</pre> |
400 0: 401</pre> |
||
=={{header|RPL}}== |
|||
As big ints are limited to 499 digits, it is not possible to calculate the 47th prime number. |
|||
{{works with|HP|49}} |
|||
« <span style="color:red">{ } |
|||
1 45</span> '''FOR''' n |
|||
<span style="color:red">0</span> |
|||
'''WHILE''' <span style="color:red">2</span> OVER ^ n * <span style="color:red">1</span> + DUP ISPRIME? NOT '''REPEAT''' |
|||
DROP <span style="color:red">1</span> + |
|||
'''END''' |
|||
NIP + |
|||
'''NEXT''' |
|||
» '<span style="color:blue">TASK</span>' STO |
|||
{{out}} |
|||
<pre> |
|||
1: { 2 3 7 5 11 7 29 17 19 11 23 13 53 29 31 17 137 19 1217 41 43 23 47 97 101 53 109 29 59 31 7937 257 67 137 71 37 149 1217 79 41 83 43 173 89 181 } |
|||
</pre> |
|||
=={{header|Sidef}}== |
=={{header|Sidef}}== |