Least m such that n! + m is prime: Difference between revisions

→‎{{header|RPL}}: cleaned the code
(→‎{{header|RPL}}: cleaned the code)
Line 359:
 
=={{header|RPL}}==
« 49 0 « n←n FACT DUP NEXTPRIME SWAP - » 'n' 0 4 ROLL 1 SEQ
→ max ←n m
» '<span style="color:blue">A33932</span>' STO
« m '←n' 0 max 1 SEQ
max '←n' STO
« 49 DUP <span style="color:blue">A33932</span>
'''DO''' '←n' INCR DROP m EVAL
SWAP
'''DOUNTIL''' 11000 > '''END''' +
←n
DUP FACT DUP NEXTPRIME SWAP -
» » '<span style="color:blue">A33932TASK</span>' STO
'''UNTIL''' 1000 > '''END'''
» '<span style="color:blue">TASK</span>' STO
{{out}}
<pre>
1,151

edits