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.

Showing 1-10 of 13 results. Next

A014778 Numbers k equal to the number of 1's in the decimal digits of all numbers <= k.

Original entry on oeis.org

0, 1, 199981, 199982, 199983, 199984, 199985, 199986, 199987, 199988, 199989, 199990, 200000, 200001, 1599981, 1599982, 1599983, 1599984, 1599985, 1599986, 1599987, 1599988, 1599989, 1599990, 2600000, 2600001, 13199998, 35000000
Offset: 1

Views

Author

Yves Babe, Maurice Protat, Olivier Gérard

Keywords

Comments

The full list of 84 terms is given in the b-file.
It can be proved that this sequence is finite. (The main idea of the proof is that the number of 1's used in positive integers <= k is greater than or equal to A(k) = (1/10)*(number of digits in positive integers from 1 to k) = (1/10) Sum_{i=1..k} (1+floor(log_10 i)). By considering the area below a logarithmic function and the corresponding integral, it can be shown that A(k)/k goes to infinity.) - Joseph L. Pe, Nov 05 2002
Fixed points of A094798. Sequence consists of six runs of ten consecutive numbers, ten pairs of consecutive numbers and four isolated numbers. - David Wasserman, Jun 29 2007

Examples

			a(5)=199983 because the number of 1's in the decimal digits of the numbers from 0 to 199983 is 199983 and this is the 5th such number.
		

References

  • Maurice Protat, "Des Olympiades à l'Agrégation", Editions Ellipses, Paris 1997, p. 183.

Crossrefs

Cf. A101639, A101640, A101641, A130427, A130428, A130429, A130430, A130431; cf. A130432 for the number of numbers in these sequences.
Cf. A094798.
Cf. A165617 for the sequence generalized to an arbitrary base. - Martin J. Erickson (erickson(AT)truman.edu), Oct 08 2010

Programs

  • Mathematica
    Join[{0},With[{nn=35*10^6},Position[Thread[{Accumulate[ DigitCount[ Range[nn],10,1]], Range[nn]}],{x_,x_}]]]//Flatten (* Harvey P. Dale, Oct 14 2017 *)
  • Python
    from itertools import count, islice
    def agen(s=0): # generator of terms
        yield from (k for k in count(0) if (s:=s+str(k).count('1'))==k)
    print(list(islice(agen(),26))) # Michael S. Branicky, Oct 02 2023

Extensions

Corrected and extended by Deepan Majmudar (deepan.majmudar(AT)hp.com), Nov 19 2004
41 further terms from Ryan Propper, Dec 07 2004, who observed that there are no more terms <= 10^9
The final (84th) term 1111111110 was sent by Lambrecht Kok (L.P.Kok(AT)rug.nl), Jan 13 2005. He says: "H. van Haeringen and I showed that this list of 84 terms is complete on Dec 15 2004".
Independently shown to be complete by Ryan Propper and Vaughan Pratt, Jan 08 2005
Edited by M. F. Hasler, Feb 12 2013

A101640 Positive integers n for which n = f(n), where f(n) is the total number of 3's required when writing out all numbers between 0 and n.

Original entry on oeis.org

371599983, 371599984, 371599985, 371599986, 371599987, 371599988, 371599989, 371599990, 371599991, 371599992, 500000000, 10000000000, 10371599983, 10371599984, 10371599985, 10371599986, 10371599987, 10371599988
Offset: 1

Views

Author

Ryan Propper, Dec 10 2004

Keywords

Comments

Related to a problem posed by Google and discussed on the MathWorld link.
Together with the b-file, this gives the complete list of all 35 positive numbers n such that n is equal to the number of 3's in the decimal digits of all numbers <= n. - Daniel Hirschberg (dan(AT)ics.uci.edu), May 05 2007

Examples

			a(1) = 371599983, since writing out all numbers from 0 to 371599983 requires that 371599983 3's be used and since 371599983 is the first such positive integer.
a(4) = 371599986 because the number of 3's in the decimal digits of the numbers from 1 to 371599986 is 371599986 and this is the 4th such number.
		

Crossrefs

Cf. A014778 for proof these sequences are finite; Also A101639, A101641, A130427, A130428, A130429, A130430, A130431; cf. A130432 for the number of numbers in these sequences.

Extensions

More terms from Daniel Hirschberg (dan(AT)ics.uci.edu), May 05 2007

A101641 Positive integers n for which n = f(n), where f(n) is the total number of 4's required when writing out all numbers between 0 and n.

Original entry on oeis.org

499999984, 499999985, 499999986, 499999987, 499999988, 499999989, 499999990, 499999991, 499999992, 499999993, 500000000, 10000000000, 10499999984, 10499999985, 10499999986, 10499999987, 10499999988, 10499999989
Offset: 1

Views

Author

Ryan Propper, Dec 11 2004

Keywords

Comments

Related to a problem posed by Google and discussed on the MathWorld link.
Together with the b-file, this gives the complete list of all 47 positive numbers n such that n is equal to the number of 4's in the decimal digits of all numbers <= n. - Daniel Hirschberg (dan(AT)ics.uci.edu), May 05 2007

Examples

			a(1) = 499999984, since writing out all numbers from 0 to 499999984 requires that 499999984 4's be used and since 499999984 is the first such positive integer.
a(4) = 499999987 because the number of 4's in the decimal digits of the numbers from 1 to 499999987 is 499999987 and this is the 4th such number.
		

Crossrefs

Cf. A014778 for proof these sequences are finite; Also A101639, A101640, A130427, A130428, A130429, A130430, A130431; cf. A130432 for the number of numbers in these sequences.

Formula

a(n) = 499999983 + n, n <= 10; a(n) = 500000000, n = 11

Extensions

More terms from Daniel Hirschberg (dan(AT)ics.uci.edu), May 05 2007
Keyword added by Charles R Greathouse IV, Jul 22 2010

A130428 List of numbers n such that n is equal to the number of 6's in the decimal digits of all numbers <= n.

Original entry on oeis.org

0, 9500000000, 9628399986, 9628399987, 9628399988, 9628399989, 9628399990, 9628399991, 9628399992, 9628399993, 9628399994, 9628399995, 10000000000, 19500000000, 19628399986, 19628399987, 19628399988, 19628399989
Offset: 1

Views

Author

Graeme McRae, May 26 2007

Keywords

Comments

A finite sequence with 72 terms.

Examples

			a(5)=9628399988 because the number of 6's in the decimal digits of the numbers from 0 to 9628399988 is 9628399988 and this is the 5th such number.
		

Crossrefs

Cf. A014778 for proof these sequences are finite; Also A101639, A101640, A101641, A130427, A130429, A130430, A130431; Cf. A130432 for the number of numbers in these sequences.

A130430 List of numbers n such that n is equal to the number of 8's in the decimal digits of all numbers <= n.

Original entry on oeis.org

0, 9465000000, 9486799989, 9486799990, 9486799991, 9486799992, 9486799993, 9486799994, 9486799995, 9486799996, 9486799997, 9497400000, 9498399989, 9498399990, 9498399991, 9498399992, 9498399993, 9498399994, 9498399995
Offset: 1

Views

Author

Graeme McRae, May 26 2007

Keywords

Comments

A finite sequence with 344 terms.

Examples

			a(5)=9486799991 because the number of 8's in the decimal digits of the numbers from 0 to 9486799991 is 9486799991 and this is the 5th such number.
		

Crossrefs

Cf. A014778 for proof these sequences are finite; Also A101639, A101640, A101641, A130427, A130428, A130429, A130431; Cf. A130432 for the number of numbers in these sequences.

A101639 Positive integers n for which n = f(n), where f(n) is the total number of 2's required when writing out all numbers between 0 and n.

Original entry on oeis.org

28263827, 35000000, 242463827, 500000000, 528263827, 535000000, 10000000000, 10028263827, 10035000000, 10242463827, 10500000000, 10528263827, 10535000000
Offset: 1

Views

Author

Ryan Propper, Dec 10 2004

Keywords

Comments

Related to a problem posed by Google and discussed on the MathWorld link.
This is the complete list of all 13 positive numbers n such that n is equal to the number of 2's in the decimal digits of all numbers <= n. - Daniel Hirschberg (dan(AT)ics.uci.edu), May 05 2007

Examples

			a(1) = 28263827 since writing out all numbers from 0 to 28263827 requires that 28263827 2's be used and since 28263827 is the first such positive integer.
a(4) = 500000000 because the number of 2's in the decimal digits of the numbers from 1 to 500000000 is 500000000 and this is the 4th such number.
		

Crossrefs

Cf. A014778 for proof these sequences are finite; Also A101640, A101641, A130427, A130428, A130429, A130430, A130431; cf. A130432 for the number of numbers in these sequences.

Extensions

More terms from Daniel Hirschberg (dan(AT)ics.uci.edu), May 05 2007

A130427 Complete list of all 5 numbers n such that n is equal to the number of 5's in the decimal digits of all numbers <= n.

Original entry on oeis.org

0, 10000000000, 20000000000, 30000000000, 40000000000
Offset: 1

Views

Author

Graeme McRae, May 26 2007

Keywords

Examples

			a(5) = 40000000000 because the number of 5's in the decimal digits of the numbers from 0 to 40000000000 is 40000000000 and this is the 5th such number.
		

Crossrefs

Cf. A014778 for proof these sequences are finite; Also A101639, A101640, A101641, A130428, A130429, A130430, A130431; Cf. A130432 for the number of numbers in these sequences.

A130431 Complete list of all 9 numbers n such that n is equal to the number of 9's in the decimal digits of all numbers <= n.

Original entry on oeis.org

0, 10000000000, 20000000000, 30000000000, 40000000000, 50000000000, 60000000000, 70000000000, 80000000000
Offset: 1

Views

Author

Graeme McRae, May 26 2007

Keywords

Examples

			a(5)=40000000000 because the number of 9's in the decimal digits of the numbers from 0 to 40000000000 is 40000000000 and this is the 5th such number.
		

Crossrefs

Cf. A014778 for proof these sequences are finite; Also A101639, A101640, A101641, A130427, A130428, A130429, A130430; Cf. A130432 for the number of numbers in these sequences.

A130432 For digit n from 1 to 9, a(n) = the number of numbers m such that m is equal to the number of n's in the decimal digits of all numbers <= m.

Original entry on oeis.org

84, 14, 36, 48, 5, 72, 49, 344, 9
Offset: 1

Views

Author

Graeme McRae, May 26 2007

Keywords

Comments

Note: sequences A101639, A101640 and A101641 are defined so that they exclude 0, so they have 13, 35 and 47 elements, respectively. This sequence counts all the zeros, so elements 2,3,4 of this sequence are 14,36,48.

Examples

			a(3)=36 because there are 36 numbers m such that m is equal to the number of 3's in the decimal digits of all numbers <= m.
		

Crossrefs

See A014778 for proof that these sequences are finite and also A101639, A101640, A101641, A130427, A130428, A130429, A130430, A130431 for the numbers themselves.

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

Views

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
Showing 1-10 of 13 results. Next