Composite numbers k with no single digit factors whose factors are all substrings of k: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) (Added Arturo implementation) |
|||
Line 236: | Line 236: | ||
5526173 11610313 13436683 13731373 13737841 13831103 15813251 17692313 19173071 28118827 |
5526173 11610313 13436683 13731373 13737841 13831103 15813251 17692313 19173071 28118827 |
||
</pre> |
</pre> |
||
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
|||
<lang Mathematica>ClearAll[CompositeAndContainsPrimeFactor] |
|||
CompositeAndContainsPrimeFactor[k_Integer] := Module[{id, pf}, |
|||
If[CompositeQ[k], |
|||
pf = FactorInteger[k][[All, 1]]; |
|||
If[AllTrue[pf, GreaterThan[10]], |
|||
id = IntegerDigits[k]; |
|||
AllTrue[pf, SequenceCount[id, IntegerDigits[#]] > 0 &] |
|||
, |
|||
False |
|||
] |
|||
, |
|||
False |
|||
] |
|||
] |
|||
out = Select[Range[30000000], CompositeAndContainsPrimeFactor]</lang> |
|||
{{out}} |
|||
<pre>{15317, 59177, 83731, 119911, 183347, 192413, 1819231, 2111317, 2237411, 3129361, 5526173, 11610313, 13436683, 13731373, 13737841, 13831103, 15813251, 17692313, 19173071, 28118827}</pre> |
|||
=={{header|Pascal}}== |
=={{header|Pascal}}== |