login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
In A048991, n is excluded if it appears in the concatenation of all earlier terms. This sequence applies the opposite criterion and excludes n if it does NOT appear in the concatenation of all earlier terms. For example, the sequences starts with 1, 2, 3, ..., therefore 12, 23 and 123 appear in the sequence, but 10, 11 and 14 do not.
LINKS
FORMULA
digits(n,i=1,j) = substring(sequence,i=1,j))
EXAMPLE
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.
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
PROG
(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<dmx, n++; dig=digits(n, b); dii=1; ok=0; for(i=1, di-#dig+1, while(dii<#dig && d[i+dii-1]==dig[dii], dii++); if(dii==#dig && d[i+dii-1]==dig[dii], ok=1; i=di-#dig+1, dii=1); ); if(ok, print1(n, ", "); for(i=1, #dig, di++; if(di<=dmx, d[di]=dig[i]) ); ); ); }
CROSSREFS
Cf. A048991.
Sequence in context: A352927 A200372 A059043 * A138141 A228017 A346535
KEYWORD
nonn,base,easy
AUTHOR
Anthony Sand, Jun 22 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 06:24 EDT 2024. Contains 371769 sequences. (Running on oeis4.)