cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A164321 #18 May 24 2023 17:19:17
%S A164321 199991,28263828,371599993,499999994,5555555555,6666666666,7777777777,
%T A164321 8888888888,9999999999
%N 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.
%C A164321 a(10) <= 10^92 + 10^91 - 90. - _Giovanni Resta_, Aug 13 2019
%H A164321 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 A164321 (Scheme) ;; This is a program in PLT Scheme, a.k.a. mzscheme
%o A164321 (define (count-matches re str start-pos)
%o A164321 (let ((m (regexp-match-positions re str start-pos)))
%o A164321 (if m (+ 1 (count-matches re str (+ (caar m) 1))) 0)))
%o A164321 (define (matches-n-in-zero-to-k fn n)
%o A164321 (do ((sum-so-far 1)
%o A164321 (k (+ n 1))
%o A164321 (re (regexp (format "~a" n))))
%o A164321 ((fn sum-so-far k) k)
%o A164321 (when (equal? 0 (modulo k 1000000))
%o A164321 (display (format "~a ~a ~a\n" n k sum-so-far)))
%o A164321 (set! k (+ k 1))
%o A164321 (set! sum-so-far
%o A164321 (+ sum-so-far (count-matches re (format "~a" k) 0)))))
%o A164321 (define (s n)
%o A164321 (matches-n-in-zero-to-k > n))
%Y A164321 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 A164321 nonn,base,more
%O A164321 1,1
%A A164321 _Gregory Marton_, Aug 12 2009