A259236 Increasing sequence of numbers n such that the digits of n appear as a substring of the concatenation of the terms < n of the sequence, which is seeded with 1..9.
1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 23, 34, 45, 56, 67, 78, 89, 91, 99, 122, 123, 199, 212, 221, 222, 223, 231, 232, 233, 234, 312, 319, 322, 323, 332, 333, 334, 343, 344, 345, 431, 433, 434, 443, 444, 445, 454, 455, 456, 543, 544, 545, 554, 555, 556, 565, 566, 567, 654, 655, 656, 665, 666, 667, 676, 677, 678, 765, 766, 767, 776, 777
Offset: 1
Examples
The digits of 12 appear earlier in the sequence (1, 2...), therefore 12 is included. The digits of 11 do not appear earlier in the sequence, therefore 11 is excluded.
Links
- Anthony Sand, Table of n, a(n) for n = 1..1000
Crossrefs
Cf. A048991.
Programs
-
Maple
M:= 4: # to get all terms with <= M digits with(StringTools): S:= "123456789": nS:= length(S): Substrings:= {seq(seq(SubString(S,a..b),b=a+1..min(9,a+M-1)),a=1..8)}: Cands:= map(parse,Substrings): for n from 1 to 9 do A[n]:= n od: for n from 10 while Cands <> {} do m:= min(Cands); A[n]:= m; S:= cat(S,convert(m,string)); nm:= length(m); newSubstrings:= {seq(seq(SubString(S,a..b), b = a+nm-1..min(nS+nm, a+M-1)),a=1+nS-M .. nS)}; Cands:= select(`>`,Cands union map(parse,newSubstrings), m); nS:= length(S); od: seq(A[i],i=1..n-1); # Robert Israel, Jun 22 2015
-
PARI
{ dmx=1000; d=vector(dmx); b=10; for(i=1,b-1,d[i]=i;print1(i,", ")); di=b-1; n=di; while(di
Formula
digits(n,i=1,j) = substring(sequence,i=1,j))
Comments