%I
%S 199991,28263828,371599993,499999994,5555555555,6666666666,7777777777,
%T 8888888888,9999999999
%N Let s(n) be the smallest number x such that the decimal representation of n appears as a substring of the decimal representations of the numbers [0...x] more than x times.
%C a(10) <= 10^92 + 10^91  90.  _Giovanni Resta_, Aug 13 2019
%o (Other) ;; This is a program in PLT Scheme, a.k.a. mzscheme
%o (define (countmatches re str startpos)
%o (let ((m (regexpmatchpositions re str startpos)))
%o (if m (+ 1 (countmatches re str (+ (caar m) 1))) 0)))
%o (define (matchesninzerotok fn n)
%o (do ((sumsofar 1)
%o (k (+ n 1))
%o (re (regexp (format "~a" n))))
%o ((fn sumsofar k) k)
%o (when (equal? 0 (modulo k 1000000))
%o (display (format "~a ~a ~a\n" n k sumsofar)))
%o (set! k (+ k 1))
%o (set! sumsofar
%o (+ sumsofar (countmatches re (format "~a" k) 0)))))
%o (define (s n)
%o (matchesninzerotok > n))
%Y Closely related to A163500 substituting > for = as suggested by Alexey Radul. The first term is given in the related A092175 which also generalizes the sequence for bases other than 10.
%K more,nonn,base
%O 1,1
%A _Gregory Marton_, Aug 12 2009
