OFFSET
1,2
COMMENTS
Number of terms less than 10^k: 1, 2, 5, 9, 16, 30, 53, 92, 163, 286, 497, 869, 1516, 2639, 4606, 8032, 13993, ..., . - Robert G. Wilson v
Number of terms of k digits: 1, 1, 3, 4, 7, 14, 23, 39, 71, 123, 211, 372, 647, 1123, 1967, 3426, 5961, ..., ; not the same as A003242. - Robert G. Wilson v
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..8032
MATHEMATICA
(* first do *) Needs["Combinatorica`"] (* then *) f[n_] := Block[{ pa=Partitions@ n, len = PartitionsP@ n, s, lst, lmt}, s = Select[Range@len, pa[[ #, 1]] < 10 &]; lst=Take[pa, {s[[1]], -1}]; lst = Flatten[ DistinctPermutations /@ lst, 1]; lmt = Length@ lst; While[lmt != 0, If[ Split[lst[[lmt]]] != Partition[lst[[lmt]], 1], lst = Delete[lst, lmt]]; lmt-- ]; Sort@ (FromDigits /@ Flatten /@ (lst /. {x_Integer -> Table[x, {x}]}))] (* Robert G. Wilson v, May 25 2008 *)
Select[Range[1250000], AllTrue[Split[IntegerDigits[#]], Length[#] == #[[1]]&]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 04 2019 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Rick L. Shepherd, May 03 2008
EXTENSIONS
Definition expanded by N. J. A. Sloane, May 20 2008
STATUS
approved