Palindromic primes: Difference between revisions
→{{header|ALGOL 68}}: Use ALGOL 68-primes
m (→{{header|REXX}}: changed the GENP subroutine.) |
(→{{header|ALGOL 68}}: Use ALGOL 68-primes) |
||
Line 8:
=={{header|ALGOL 68}}==
Generates the palindrmic 3 digit numbers and uses the observations that all 1 digit primes are palindromic and that for 2 digit numbers, only multiples of 11 are palindromic and hence 11 is the only two digit palindromic prime.
{{libheader|ALGOL 68-primes}}
<lang algol68>BEGIN # find primes that are palendromic in base 10 #
INT max prime = 999;
# sieve the primes to max prime #
PR read "primes.incl.a68" PR
# print the palendromic primes in the base 10 #
# all 1 digit primes are palindromic #
|