%I #14 Nov 17 2024 07:10:00
%S 11,22,33,44,55,66,77,88,99,111,112,113,114,115,116,117,118,119,122,
%T 133,144,155,166,177,188,199,222,223,224,225,226,227,228,229,233,244,
%U 255,266,277,288,299,333,334,335,336,337,338,339,344,355,366,377,388,399
%N Numbers that have at least 1 repeated decimal digit and whose decimal digits are nondecreasing as place value decreases.
%C Intersection of A009994 and A109303.
%C Does not intersect either A009993 or A009995.
%H Michael De Vlieger, <a href="/A377948/b377948.txt">Table of n, a(n) for n = 1..10938</a> (includes all numbers up to 7 digits long)
%F A178788(a(n)) = 0.
%t Select[Range[10^6], And[CountDistinct[#] != Length[#], AllTrue[Differences[#], # >= 0 &]] &[IntegerDigits[#]] &]
%t (* More efficient program: *)
%t b = 10; mm = b - 1; nn = 14;
%t s = Table[Map[Position[#, 1][[All, 1]] &,
%t Permutations@ Join[ConstantArray[1, r], ConstantArray[0, mm - r] ] ],
%t {r, Min[mm, nn]}];
%t Union@ Flatten@ Table[
%t w = Apply[Join, Permutations /@ IntegerPartitions[n, Min[mm, n - 1] ] ];
%t Reap[Do[
%t Sow[Table[FromDigits[Flatten@
%t MapIndexed[ConstantArray[m[[First[#2] ]], #1] &,
%t w[[i]]], b], {m, s[[Length[w[[i]] ]]} ] ],
%t {i, Length[w]}] ][[-1, 1]], {n, 2, nn}]
%Y Cf. A009993, A009994, A009995, A109303, A178788.
%K nonn,base,easy
%O 1,1
%A _Michael De Vlieger_, Nov 14 2024