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 17:15, 14 May 2023
, 1 year agoSet the number of results to 20 as required.
(Created Nim solution.) |
(Set the number of results to 20 as required.) |
||
Line 353:
We use a sieve to build a list of prime factors. This is more efficient than computing the list of prime factors on the fly.
To find the
<syntaxhighlight lang="Nim">import std/[strformat, strutils]
Line 372:
primeFactors(k).add n
const N =
var n = 11 * 11
var count = 0
Line 407:
19: 19_173_071
20: 28_118_827
</pre>
|