Jump to content

Truncatable primes: Difference between revisions

m
Regularize non-standard header markup
(Added Swift solution)
m (Regularize non-standard header markup)
Line 1,568:
998443</lang>
 
== {{header|Icon}} and {{header|Unicon}}==
<lang Icon>procedure main(arglist)
N := 0 < integer(\arglist[1]) | 1000000 # primes to generator 1 to ... (1M or 1st arglist)
Line 1,608:
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.
Line 2,742:
MessageRequester("Truncatable primes",x+#CRLF$+y)</lang>
 
== {{header|Python}} ==
<lang python>maxprime = 1000000
 
10,333

edits

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