OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10938 (includes all numbers up to 7 digits long)
FORMULA
A178788(a(n)) = 0.
MATHEMATICA
Select[Range[10^6], And[CountDistinct[#] != Length[#], AllTrue[Differences[#], # >= 0 &]] &[IntegerDigits[#]] &]
(* More efficient program: *)
b = 10; mm = b - 1; nn = 14;
s = Table[Map[Position[#, 1][[All, 1]] &,
Permutations@ Join[ConstantArray[1, r], ConstantArray[0, mm - r] ] ],
{r, Min[mm, nn]}];
Union@ Flatten@ Table[
w = Apply[Join, Permutations /@ IntegerPartitions[n, Min[mm, n - 1] ] ];
Reap[Do[
Sow[Table[FromDigits[Flatten@
MapIndexed[ConstantArray[m[[First[#2] ]], #1] &,
w[[i]]], b], {m, s[[Length[w[[i]] ]]} ] ],
{i, Length[w]}] ][[-1, 1]], {n, 2, nn}]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Michael De Vlieger, Nov 14 2024
STATUS
approved