Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
23
Task/Colorful-numbers/Mathematica/colorful-numbers.math
Normal file
23
Task/Colorful-numbers/Mathematica/colorful-numbers.math
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
ClearAll[ColorfulNumberQ]
|
||||
ColorfulNumberQ[n_Integer?NonNegative] := Module[{digs, parts},
|
||||
If[n > 98765432,
|
||||
False
|
||||
,
|
||||
digs = IntegerDigits[n];
|
||||
parts = Partition[digs, #, 1] & /@ Range[1, Length[digs]];
|
||||
parts //= Catenate;
|
||||
parts = Times @@@ parts;
|
||||
DuplicateFreeQ[parts]
|
||||
]
|
||||
]
|
||||
Multicolumn[Select[Range[99], ColorfulNumberQ], Appearance -> "Horizontal"]
|
||||
|
||||
sel = Union[FromDigits /@ Catenate[Permutations /@ Subsets[Range[2, 9], {1, \[Infinity]}]]];
|
||||
sel = Join[sel, {0, 1}];
|
||||
cns = Select[sel, ColorfulNumberQ];
|
||||
|
||||
Max[cns]
|
||||
|
||||
Tally[IntegerDigits/*Length /@ cns] // Grid
|
||||
|
||||
Length[cns]
|
||||
Loading…
Add table
Add a link
Reference in a new issue