cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A140057 Numbers such that each decimal digit d (for all d in the range 1 <= d <= 9) occurs only in runs of length exactly d.

This page as a plain text file.
%I A140057 #11 Aug 04 2019 18:25:51
%S A140057 1,22,122,221,333,1221,1333,3331,4444,13331,14444,22122,22333,33322,
%T A140057 44441,55555,122122,122333,133322,144441,155555,221221,221333,223331,
%U A140057 224444,333122,333221,444422,555551,666666,1221221,1221333,1223331
%N A140057 Numbers such that each decimal digit d (for all d in the range 1 <= d <= 9) occurs only in runs of length exactly d.
%C A140057 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_
%C A140057 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_
%H A140057 Robert G. Wilson v, <a href="/A140057/b140057.txt">Table of n, a(n) for n = 1..8032</a>
%t A140057 (* 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 *)
%t A140057 Select[Range[1250000],AllTrue[Split[IntegerDigits[#]],Length[#] == #[[1]]&]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Aug 04 2019 *)
%K A140057 base,easy,nonn
%O A140057 1,2
%A A140057 _Rick L. Shepherd_, May 03 2008
%E A140057 Definition expanded by _N. J. A. Sloane_, May 20 2008