OFFSET
1,2
COMMENTS
Similar to the "punctual birds" A131881, numbers which do not occur earlier than their "natural" position in the string 123...9101112..., but more complex to compute due to the fact that here the omitted numbers must be taken into account. Contains powers of ten A011557 as a subsequence, at indices (1, 10, 63, 402, 2954, ...), giving the number of n-digit terms as (9, 53, 339, 2552, ...). - M. F. Hasler, Oct 25 2019
REFERENCES
Invented by 10-year-old Hannah Rollman.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
Nick Hobson, Python program for this sequence
EXAMPLE
12 is omitted since we see "1,2" at the beginning of the sequence; 101 is omitted because we can see "10,1[1]"; etc.
Since 12 is omitted, 21 does not occur "earlier" and it is in this sequence, but not in A131881, since it occurs earlier in "12,13". - M. F. Hasler, Oct 25 2019
MATHEMATICA
Clear[a]; a[1] = 1; s = "1"; a[n_] := a[n] = Catch[ For[k = a[n-1] + 1, True, k++, If[ StringFreeQ[s, t = ToString[k]], s = s <> t; Throw[k] ] ] ]; Table[a[n], {n, 1, 75}] (* Jean-François Alcover, Jan 09 2013 *)
PROG
(Python) # see Hobson link
(Haskell)
import Data.List (isInfixOf)
a048991 n = a048991_list !! (n-1)
a048991_list = f [1..] [] where
f (x:xs) ys | xs' `isInfixOf` ys = f xs ys
| otherwise = x : f xs (xs' ++ ys)
where xs' = reverse $ show x
-- Reinhard Zumkeller, Dec 05 2011
(PARI) D=[]; for(n=1, 199, for(i=0, #D-#d=digits(n), D[i+1..i+#d]==d && next(2)); print1(n", "); D=concat(D, d)) \\ M. F. Hasler, Oct 25 2019
CROSSREFS
KEYWORD
nonn,nice,base,easy
AUTHOR
EXTENSIONS
Edited by Patrick De Geest, Jun 02 2003
STATUS
approved