Composite numbers k with no single digit factors whose factors are all substrings of k: Difference between revisions
Composite numbers k with no single digit factors whose factors are all substrings of k (view source)
Revision as of 23:02, 19 January 2022
, 2 years ago→{{header|Julia}}
(Added Wren) |
|||
Line 15:
=={{header|Julia}}==
<lang julia>using Lazy
using Primes
containsitsonlytwodigfactors(n) = (s = string(n); !isprime(n) && all(t -> length(t) > 1 && contains(s, t), map(x -> string(x), collect(keys(factor(n))))))
seq = @>> Lazy.range(2) filter(containsitsonlytwodigfactors)
foreach(p -> print(lpad(last(p), 9), first(p) == 10 ? "\n" : ""), enumerate(take(20, seq)))
</lang>{{out}}
<pre>
15317 59177 83731 119911 183347 192413 1819231 2111317 2237411 3129361
5526173 11610313 13436683 13731373 13737841 13831103 15813251 17692313 19173071 28118827
</pre>
|