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.

User: Gregory Marton

Gregory Marton's wiki page.

Gregory Marton has authored 4 sequences.

A364972 Bases >= 2 in which the number of zeros needed to write the numbers 1 through k never equals k for any k.

Original entry on oeis.org

3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 27, 30, 32, 35, 37, 38, 39, 40, 41, 43, 45, 48, 49, 53, 54, 57, 58, 59, 63, 65, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 79, 80, 83, 85, 88, 89, 90, 93, 94, 95, 96, 98, 100
Offset: 1

Author

Gregory Marton and Tanya Khovanova, Aug 14 2023

Keywords

Comments

We gave a theoretical upper bound, and experimentally checked values under that bound.

Examples

			11 and 13 are not in this sequence because exactly 3152738985031 zeros (expressed here for convenience in decimal) are needed to write the numbers from 1 to 3152738985031, and likewise 3950024143546664 for 13.
		

Crossrefs

Cf. A061217 (shows 10 is a term).

A163500 a(n) is the smallest number x > 1 such that n appears as a substring of the decimal representations of the numbers [0..x] exactly x times.

Original entry on oeis.org

199981, 28263827, 371599983, 499999984, 10000000000, 9500000000, 9465000000, 9465000000, 10000000000
Offset: 1

Author

Gregory Marton, Jul 29 2009, Aug 12 2009

Keywords

Comments

This is an extension of a puzzle that a student posed as: Let f(x) be a function that counts the times the digit 1 appears in the decimal representations of the numbers from 0 to x. So, for example, f(11) is 4. For what number > 1 does f(x) = x? The answer to that question is 199981, the first term of this sequence. The sequence is the natural extension of this property. a(0) doesn't exist, because for any x, [0..x] (inclusive) contains zero, meaning there is at least one matching substring, and this is a monotonically increasing function. It is not clear that a(n) is defined for all n > 0, though the related sequence which uses f(x) > x rather than f(x) = x has at least less of a feeling of caprice about it. Multidigit numbers n are clearly at a disadvantage, but I have tried to phrase it, "appears as a substring" so that, for example, 11 appears in 1111 thrice rather than twice.
a(10) <= 10^92 + 10^91 - 190. - Giovanni Resta, Aug 13 2019

Crossrefs

See also A164321 which uses > instead of =. The first nine terms are contained in the sequences 1: A014778, 2: A101639, 3: A101640, 4:A101641, 5: A130427, 6: A130428, 7: A130429, 8: A130430, 9: A130431.

Programs

  • mzscheme
    (define (count-matches re str start-pos) (let ((m (regexp-match-positions re str start-pos))) (if m (+ 1 (count-matches re str (+ (caar m) 1))) 0))) (define (matches-n-in-zero-to-k fn n) (do ((sum-so-far 1) (k (+ n 1)) (re (regexp (format "~a" n)))) ((fn sum-so-far k) k) (when (equal? 0 (modulo k 1000000)) ;; this is just a progress indicator (display (format "~a ~a ~a\n" n k sum-so-far))) (set! k (+ k 1)) (set! sum-so-far (+ sum-so-far (count-matches re (format "~a" k) 0))))) (define (s f n) (display (matches-n-in-zero-to-k f n))) ;; where f should be one of = or > depending on which sequence you care about. ;; this could be made much more efficient, of course. In particular, the ;; initial sequences up to the first x of m digits have serious regularity.

Extensions

a(5)-a(9) added by Gregory Marton, Aug 12 2009
Donovan Johnson pointed out the 6th term was incorrect, Nov 01 2010

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.

Original entry on oeis.org

199991, 28263828, 371599993, 499999994, 5555555555, 6666666666, 7777777777, 8888888888, 9999999999
Offset: 1

Author

Gregory Marton, Aug 12 2009

Keywords

Comments

a(10) <= 10^92 + 10^91 - 90. - Giovanni Resta, Aug 13 2019

Crossrefs

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.

Programs

  • Scheme
    ;; This is a program in PLT Scheme, a.k.a. mzscheme
    (define (count-matches re str start-pos)
    (let ((m (regexp-match-positions re str start-pos)))
    (if m (+ 1 (count-matches re str (+ (caar m) 1))) 0)))
    (define (matches-n-in-zero-to-k fn n)
    (do ((sum-so-far 1)
    (k (+ n 1))
    (re (regexp (format "~a" n))))
    ((fn sum-so-far k) k)
    (when (equal? 0 (modulo k 1000000))
    (display (format "~a ~a ~a\n" n k sum-so-far)))
    (set! k (+ k 1))
    (set! sum-so-far
    (+ sum-so-far (count-matches re (format "~a" k) 0)))))
    (define (s n)
    (matches-n-in-zero-to-k > n))

A164935 a(n) is the smallest number x such that the decimal representation of n appears as a substring of the decimal representations of the numbers [1...x] >= x times.

Original entry on oeis.org

100559404366, 1, 28263827, 371599983, 499999984, 5555555555, 6666666666, 7777777777, 8888888888, 9999999999, 109999999999999999999999999999999999999999999999999999999999999999999999999999999999999999810
Offset: 0

Author

Tanya Khovanova and Gregory Marton, Aug 31 2009

Keywords

Comments

Starting from n = 2, a(n) = min(A163500,A164321).

Crossrefs

Programs

  • Mathematica
    cz[n_, k_] := Floor[n/10^k] 10^(k - 1) + (Ceiling[Floor[n/10^(k - 1)]/10] - Floor[Floor[n/10^(k - 1)]/10] - 1) (10^(k - 1) - Mod[n, 10^(k - 1)] - 1) countZeroes[n_] := (z = 0; k = 1; len = Length[IntegerDigits[n]]; While[k < len, z = z + cz[n, k]; k++ ]; z) c = 8; d = 16; While[d - c > 1 , If[countZeroes[d] >= c, d = (c + d)/2, {c, d} = {d, d + 2 d - 2 c}]]; While[ countZeroes[c] < c, c++ ]; Print[c] countAny[n_, anyK_] := (z = 0; lenK = Length[IntegerDigits[anyK]]; len = Length[IntegerDigits[n]]; k = lenK;
    While[k <= len, middle = Mod[Floor[n/10^(k - lenK)], 10^lenK]; If [middle > anyK, z = z + ( Floor[n/10^k] + 1) 10^(k - lenK)]; If[middle < anyK, z = z + Floor[n/10^k] 10^(k - lenK)]; If[middle == anyK, z = z + Floor[n/10^k] 10^(k - lenK) + Mod[n, 10^(k - lenK)] + 1]; k++ ]; z) i = 1; c = 8; d = 16; While[i < 20, While[d - c > 1 , If[countAny[d, i] >= c, d = (c + d)/2, {c, d} = {d, d + 2 d - 2 c}]]; While[countAny[c, i] < c, c++ ]; Print[c]; d = c + 8; i++ ]