This site is supported by donations to The OEIS Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A164321 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. 2

%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 (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 more,nonn,base

%O 1,1

%A _Gregory Marton_, Aug 12 2009

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

Last modified October 21 06:36 EDT 2019. Contains 328292 sequences. (Running on oeis4.)