Additive primes: Difference between revisions

add RPL
No edit summary
(add RPL)
Line 3,247:
done...
</pre>
=={{header|RPL}}==
{{works with|HP|49g}}
≪ →STR 0
1 3 PICK SIZE '''FOR''' j
OVER j DUP SUB STR→ + '''NEXT''' NIP
≫ '<span style="color:blue>∑DIGITS</span>' STO
≪ { } 1
'''DO'''
NEXTPRIME
'''IF''' DUP <span style="color:blue>∑DIGITS</span> ISPRIME? '''THEN''' SWAP OVER + SWAP '''END'''
'''UNTIL''' DUP 500 ≥ '''END'''
DROP DUP SIZE
≫ '<span style="color:blue>TASK</span>' STO
{{out}}
<pre>
2: { 2 3 5 7 11 23 29 41 43 47 61 67 83 89 101 113 131 137 139 151 157 173 179 191 193 197 199 223 227 229 241 263 269 281 283 311 313 317 331 337 353 359 373 379 397 401 409 421 443 449 461 463 467 487 }
1: 54
</pre>
 
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">require "prime"
Line 3,262 ⟶ 3,282:
54 additive primes below 500.
</pre>
 
 
=={{header|Rust}}==
1,150

edits