Summarize primes: Difference between revisions

add RPL
(add RPL)
Line 1,573:
Found 21 numbers
done...
</pre>
 
=={{header|RPL}}==
{{works with|HP|49g}}
≪ { } 0 0 → display length sum
≪ 1
'''WHILE''' DUP 1000 < '''REPEAT'''
NEXTPRIME
DUP 'sum' STO+
1 'length' STO+
'''IF''' sum ISPRIME? '''THEN'''
length OVER sum 3 →LIST 1 →LIST 'display' SWAP STO+ '''END'''
'''END'''
DROP display
≫ ≫ '<span style="color:blue">TASK</span>' STO
{{out}}
<pre>
1: {{1 2 2} {2 3 5} {3 7 17} {4 13 41} {5 37 197} {6 43 281} {7 281 7699} {8 311 8893} {9 503 22039} {10 541 24133} {11 557 25237} {12 593 28697} {13 619 32353} {14 673 37561} {15 683 38921} {16 733 43201} {17 743 44683} {18 839 55837} {19 881 61027} {20 929 66463} {21 953 70241}}
</pre>
 
1,151

edits