Jump to content

Palindromic primes: Difference between revisions

add RPL
(J)
(add RPL)
Line 1,020:
Found 113 palindromic primes that are < 100,000
done...
</pre>
 
=={{header|RPL}}==
{{works with|HP|49g}}
≪ →STR → n
≪ ""
n SIZE 1 '''FOR''' j
n j DUP SUB +
-1 '''STEP''' STR→
≫ ≫ '<span style="color:blue">REVN</span>' STO
≪ { } 2
'''DO'''
'''IF''' DUP DUP <span style="color:blue">REVN</span> '''THEN''' SWAP OVER + SWAP '''END'''
NEXTPRIME
'''UNTIL''' DUP 1000 > '''END'''
DROP
≫ ≫ '<span style="color:blue">TASK</span>' STO
 
{{out}
<pre>
1: {2 3 5 7 11 101 131 151 181 191 313 353 373 383 727 757 787 797 919 929}
</pre>
 
1,150

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.