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-8 of 8 results.

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

A053541 a(n) = n*10^(n-1).

Original entry on oeis.org

1, 20, 300, 4000, 50000, 600000, 7000000, 80000000, 900000000, 10000000000, 110000000000, 1200000000000, 13000000000000, 140000000000000, 1500000000000000, 16000000000000000, 170000000000000000
Offset: 1

Views

Author

Barry E. Williams, Jan 15 2000

Keywords

Comments

This sequence gives the number of 1's (or any other nonzero digit) required to write all integers from 0 up to 10^n-1. - Jason D. W. Taff (jtaff(AT)jburroughs.org), Dec 05 2004 (improved by Bernard Schott, Nov 17 2022)
The corresponding number of 0's required to write all these integers from 0 up to 10^n-1 is A033714(n). - Bernard Schott, Nov 17 2022

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover, N.Y., 1964, pp. 194-196.

Crossrefs

Programs

Formula

a(n) = 20*a(n-1) - 100*a(n-2), with a(0)=0, a(1)=1, a(2)=20.
From Jason D. W. Taff (jtaff(AT)jburroughs.org), Dec 05 2004: (Start)
a(n) = 10*a(n-1) + 10*(n-1).
a(n) = Sum_{k=1..n} k*binomial(n,k)*9^(n-k).
a(n) = A094798(10^n - 1). (End)
From G. C. Greubel, May 16 2019: (Start)
G.f.: x/(1-10*x)^2.
E.g.f.: x*exp(10*x). (End)
From Amiram Eldar, Oct 28 2020: (Start)
Sum_{n>=1} 1/a(n) = 10*log(10/9).
Sum_{n>=1} (-1)^(n+1)/a(n) = 10*log(11/10). (End)
a(n) = Sum_{k=1..n} A081045(k-1). - Bernard Schott, Nov 17 2022

Extensions

Offset changed from 0 to 1 by Vincenzo Librandi, Jun 06 2011

A094799 First term of a run of 10 consecutive numbers such that for each m in the 10-tuple exactly m 1's are used in writing out all numbers 1 through m.

Original entry on oeis.org

199981, 1599981, 35199981, 500199981, 501599981, 535199981
Offset: 1

Views

Author

Lekraj Beedassy, Jun 11 2004

Keywords

Comments

The sequence is complete. - David Wasserman, Jun 29 2007

References

  • M. Protat, Des Olympiades a l'Agregation, Nombre de "1", Problem 89, pp. 182-183, Ellipses, Paris 1997.

Crossrefs

Cf. A014778.
Cf. A094798.

A331375 a(n) is the number of times the digit 1 appears in the concatenation of integers from 0 to n, minus the number of times the next most frequent digit appears.

Original entry on oeis.org

-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 9, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Scott R. Shannon, Jan 14 2020

Keywords

Comments

Other than a(0) = 0 the digit 1 is the most frequently seen digit in the concatenation of the integers from 0 to n. See A094798 for the exact number of times. This sequence is the difference between that number and the number of times the next most frequent digit appears. For almost all numbers the next most frequent digit is 2. That only changes to the digit 0 once per order of magnitude, after reaching the number consisting of two or more 1's followed by 0. The digit 0 keeps this record for the next number, a repunit, after which the number of appearances of 2 again either equals or surpasses the number of appearances of 0.
When concatenating the integers from 0 to 10^k, with k >= 2, this sequence reaches its maximum value of 10^(k-1) at n = 10^k/5-1.

Examples

			a(0) = -1 as after '0' the digit 0 has appeared once while 1 has not appeared, so a(0) = 0 - 1 = -1.
a(10) = 0 as after '012345678910' the digits 0 and 1 have both appeared two times, so a(10) = 2 - 2 = 0.
a(11) = 2 as after '01234567891011' the digit 1 has appeared four times and the digit 0 two times, so a(11) = 4 - 2 = 2.
		

Crossrefs

Extensions

Deleted a conjectured but incorrect g.f. and recurrence. - N. J. A. Sloane, Jan 17 2020

A094800 First term of a run of exactly two consecutive numbers such that for each m in the run, exactly m 1's are used in writing out all numbers 1 through m.

Original entry on oeis.org

0, 200000, 2600000, 35000000, 35200000, 500000000, 500200000, 502600000, 535000000, 535200000
Offset: 1

Views

Author

Lekraj Beedassy, Jun 11 2004

Keywords

Comments

Numbers n such that n and n+1 are members of A014778, but n-1 and n+2 are not. - David Wasserman

References

  • M. Protat, Des Olympiades a l'Agregation, Nombre de "1", Problem 89, pp. 182-183, Ellipses, Paris 1997.

Crossrefs

Extensions

Corrected by David Wasserman, Jun 29 2007. There are no further terms.

A094801 Numbers k such that k is a term of A014778, but k-1 and k+1 are not.

Original entry on oeis.org

13199998, 117463825, 513199998, 1111111110
Offset: 1

Views

Author

Lekraj Beedassy, Jun 11 2004

Keywords

References

  • M. Protat, Des Olympiades a l'Agregation, Nombre de "1", Problem 89, pp. 182-183, Ellipses, Paris 1997.

Crossrefs

Extensions

Corrected by David Wasserman, Jun 29 2007

A365097 Smallest k > 1 such that the total number of digits "1" required to write the numbers 1..k in base n is equal to k.

Original entry on oeis.org

2, 4, 25, 181, 421, 3930, 8177, 102772, 199981, 3179142, 5971945, 143610511, 210826981, 4754446846, 8589934561, 222195898593, 396718580701, 13494919482970, 20479999999961, 764527028941797, 1168636602822613, 41826814261329722, 73040694872113105, 2855533828630999398
Offset: 2

Views

Author

Andrew Pope, Aug 21 2023

Keywords

Comments

a(10) = A014778(3), being the smallest term > 1 there.
An upper bound is a(n) <= A226238(n) = u, since the digits of u show there are u 1's in numbers 1..u (in base n). - Kevin Ryde, Sep 28 2023

Examples

			For n=2, the first k=2 positive integers are 1 = 1_2 and 2 = 10_2, which have a total of two 1's, so a(2) = 2.
For n=3, the first k=4 positive integers, which are 1_3, 2_3, 10_3, and 11_3, have a total of four 1's, which is equal to k, so a(3) = 4.
For n=4, a total of 25 1's occur in the first k=25 positive integers (they occur in 1_4, 10_4, 11_4, 12_4, 13_4, 21_4, 31_4, 100_4, 101_4, 102_4, 103_4, 110_4, 111_4, 112_4, 113_4, 120_4, and 121_4 = 25), so a(4) = 25.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1, sum = 1}, While[sum == 1 || sum != k, k++; sum += Count[IntegerDigits[k, n], 1]]; k]; Array[a, 6, 2] (* Amiram Eldar, Aug 29 2023 *)
  • Python
    from itertools import count
    from sympy.ntheory.factor_ import digits
    def A365097(n):
        c, a, q, m = 1, 1, 0, 1
        for k in count(2):
            m += 1
            if m == n:
                m = 0
                q += 1
                a = digits(q,n).count(1)
            elif m==1:
                a += 1
            elif m==2:
                a -= 1
            c += a
            if c == k:
                return k # Chai Wah Wu, Sep 28 2023

Formula

For even n > 2, a(n) = 2*n^(n/2) - 2*n + 1. - Jon E. Schoenfield, Sep 30 2023

Extensions

a(11)-a(15) from Amiram Eldar, Aug 29 2023
a(16)-a(19) from Chai Wah Wu, Sep 29 2023
a(20)-a(25) from Jon E. Schoenfield, Sep 30 2023

A094797 Number of times 1 is used in writing out all numbers 1 through 10^n.

Original entry on oeis.org

1, 2, 21, 301, 4001, 50001, 600001, 7000001, 80000001, 900000001, 10000000001, 110000000001, 1200000000001, 13000000000001, 140000000000001, 1500000000000001, 16000000000000001, 170000000000000001, 1800000000000000001, 19000000000000000001
Offset: 0

Views

Author

Lekraj Beedassy, Jun 11 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Table[ n*10^(n - 1) + 1, {n, 0, 17}] (* Robert G. Wilson v, Jun 15 2004 *)
    LinearRecurrence[{21,-120,100},{1,2,21},20] (* Harvey P. Dale, Sep 07 2022 *)
  • PARI
    Vec(-(99*x^2-19*x+1)/((x-1)*(10*x-1)^2) + O(x^100)) \\ Colin Barker, May 23 2014

Formula

a(n) = n*10^(n-1) + 1.
a(n) = 21*a(n-1)-120*a(n-2)+100*a(n-3). - Colin Barker, May 23 2014
G.f.: -(99*x^2-19*x+1) / ((x-1)*(10*x-1)^2). - Colin Barker, May 23 2014
a(n) = A094798(A011557(n)). - Michel Marcus, Oct 03 2023

Extensions

More terms from Robert G. Wilson v, Jun 15 2004
Further terms from Colin Barker, May 23 2014
Showing 1-8 of 8 results.