Substring primes: Difference between revisions
→{{header|ALGOL 68}}: Use ALGOL 68-primes
m (→Using a limit: Replaced getDigits function with a more recently added library function.) |
(→{{header|ALGOL 68}}: Use ALGOL 68-primes) |
||
Line 13:
=={{header|ALGOL 68}}==
{{libheader|ALGOL 68-primes}}
<lang algol68>BEGIN # find primes where all substrings of the digits are prime #
# find the primes of interest #
PR read "primes.incl.a68" PR
[]BOOL prime =
FOR p TO UPB prime DO
IF prime[ p ] THEN
INT d := 10;
BOOL is substring := TRUE;
WHILE is substring AND d <=
INT n := p;
WHILE is substring AND n > 0 DO
|