%I #18 May 24 2023 17:19:17
%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
%H Tanya Khovanova and Gregory Marton, <a href="https://arxiv.org/abs/2305.10357">Archive Labeling Sequences</a>, arXiv:2305.10357 [math.HO], 2023. See p. 4.
%o (Scheme) ;; This is a program in PLT Scheme, a.k.a. mzscheme
%o (define (count-matches re str start-pos)
%o (let ((m (regexp-match-positions re str start-pos)))
%o (if m (+ 1 (count-matches re str (+ (caar m) 1))) 0)))
%o (define (matches-n-in-zero-to-k fn n)
%o (do ((sum-so-far 1)
%o (k (+ n 1))
%o (re (regexp (format "~a" n))))
%o ((fn sum-so-far k) k)
%o (when (equal? 0 (modulo k 1000000))
%o (display (format "~a ~a ~a\n" n k sum-so-far)))
%o (set! k (+ k 1))
%o (set! sum-so-far
%o (+ sum-so-far (count-matches re (format "~a" k) 0)))))
%o (define (s n)
%o (matches-n-in-zero-to-k > 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 nonn,base,more
%O 1,1
%A _Gregory Marton_, Aug 12 2009