Jump to content

One-two primes: Difference between revisions

J draft
m (Escape clause for under-powered languages)
(J draft)
Line 19:
 
 
 
=={{header|J}}==
 
Implementation:
 
<syntaxhighlight lang=J>pr12=: {{ for_j. 10x#.1 2{~1|."1#:i.2^y do. if. 1 p:j do. j return. end. end. }}"0</syntaxhighlight>
 
Task example:
 
<syntaxhighlight lang=J> ,.pr12 1+i.20
2
11
211
2111
12211
111121
1111211
11221211
111112121
1111111121
11111121121
111111211111
1111111121221
11111111112221
111111112111121
1111111112122111
11111111111112121
111111111111112111
1111111111111111111
11111111111111212121</syntaxhighlight>
 
=={{header|Raku}}==
6,962

edits

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