Truncatable primes: Difference between revisions
Content added Content deleted
(Added Swift solution) |
Thundergnat (talk | contribs) m (Regularize non-standard header markup) |
||
Line 1,568: | Line 1,568: | ||
998443</lang> |
998443</lang> |
||
== |
=={{header|Icon}} and {{header|Unicon}}== |
||
<lang Icon>procedure main(arglist) |
<lang Icon>procedure main(arglist) |
||
N := 0 < integer(\arglist[1]) | 1000000 # primes to generator 1 to ... (1M or 1st arglist) |
N := 0 < integer(\arglist[1]) | 1000000 # primes to generator 1 to ... (1M or 1st arglist) |
||
Line 1,608: | Line 1,608: | ||
Largest right truncatable prime = 739399</pre> |
Largest right truncatable prime = 739399</pre> |
||
== |
=={{header|J}}== |
||
Truncatable primes may be constructed by starting with a set of one digit prime numbers and then repeatedly adding a non-zero digit (combine all possibilities of a truncatable prime digit sequence with each digit) and, at each step, selecting the prime numbers which result. |
Truncatable primes may be constructed by starting with a set of one digit prime numbers and then repeatedly adding a non-zero digit (combine all possibilities of a truncatable prime digit sequence with each digit) and, at each step, selecting the prime numbers which result. |
||
Line 2,742: | Line 2,742: | ||
MessageRequester("Truncatable primes",x+#CRLF$+y)</lang> |
MessageRequester("Truncatable primes",x+#CRLF$+y)</lang> |
||
== |
=={{header|Python}}== |
||
<lang python>maxprime = 1000000 |
<lang python>maxprime = 1000000 |
||