Primes whose first and last number is 3: Difference between revisions
Primes whose first and last number is 3 (view source)
Revision as of 08:13, 1 September 2023
, 9 months ago→{{header|RPL}}: compact code
(→{{header|RPL}}: improved generator) |
m (→{{header|RPL}}: compact code) |
||
Line 950:
Uses a candidate numbers generator to speed up execution.
{{works with|HP|49}}
≪ 10 +▼
'''IF''' DUP MANT IP 3 ≠ '''THEN''' XPON 1 + ALOG 3 * 3 + '''END'''▼
≪ { } 3
'''WHILE''' DUP 4000 < '''REPEAT'''
'''IF''' DUP ISPRIME? '''THEN''' SWAP OVER + SWAP '''END'''
▲ '''IF''' DUP MANT IP 3 ≠ '''THEN''' XPON 1 + ALOG 3 * 3 + '''END'''
'''END''' DROP
≫ '<span style="color:blue">33PRIMES</span>' STO
|