Composite numbers k with no single digit factors whose factors are all substrings of k: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (Promote. multiple implementations, no questions) |
Drkameleon (talk | contribs) (Added Arturo implementation) |
||
Line 76: | Line 76: | ||
5526173 11610313 13436683 13731373 13737841 13831103 15813251 17692313 19173071 28118827 |
5526173 11610313 13436683 13731373 13737841 13831103 15813251 17692313 19173071 28118827 |
||
</pre> |
</pre> |
||
=={{header|Arturo}}== |
|||
<lang rebol>valid?: function [n][ |
|||
pf: factors.prime n |
|||
every? pf 'f -> |
|||
and? [contains? to :string n to :string f] |
|||
[1 <> size digits f] |
|||
] |
|||
cnt: 0 |
|||
i: new 3 |
|||
while [cnt < 10][ |
|||
if and? [not? prime? i][valid? i][ |
|||
print i |
|||
cnt: cnt + 1 |
|||
] |
|||
'i + 2 |
|||
]</lang> |
|||
{{out}} |
|||
<pre>15317 |
|||
59177 |
|||
83731 |
|||
119911 |
|||
183347 |
|||
192413 |
|||
1819231 |
|||
2111317 |
|||
2237411 |
|||
3129361</pre> |
|||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |
||
Line 110: | Line 143: | ||
Real: 00:00:26.059 |
Real: 00:00:26.059 |
||
</pre> |
</pre> |
||
=={{header|Go}}== |
=={{header|Go}}== |
||
{{trans|Wren}} |
{{trans|Wren}} |