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.

A113119 Total number of digits in all n-digit nonnegative integers.

Original entry on oeis.org

10, 180, 2700, 36000, 450000, 5400000, 63000000, 720000000, 8100000000, 90000000000, 990000000000, 10800000000000, 117000000000000, 1260000000000000, 13500000000000000, 144000000000000000, 1530000000000000000, 16200000000000000000, 171000000000000000000
Offset: 1

Views

Author

Alexandre Wajnberg, Jan 03 2006

Keywords

Examples

			a(1)=10 because there are ten one-digit numbers (including the 0).
a(2)=180 because there are 100-10=90 two-digit numbers, for a total of 90*2=180 digits.
		

Crossrefs

Essentially the same as A212704.

Programs

  • Mathematica
    LinearRecurrence[{20,-100},{10,180,2700},20] (* Harvey P. Dale, Dec 09 2021 *)
  • PARI
    Vec(10*x*(1-2*x+10*x^2)/(1-10*x)^2 + O(x^20)) \\ Colin Barker, Aug 05 2016
    
  • Python
    def a(n): return 10 if n == 1 else 9*n*10**(n-1)
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Nov 14 2022

Formula

For n > 1, a(n) = 9*n*10^(n-1).
From Colin Barker, Aug 05 2016: (Start)
a(n) = 20*a(n-1) - 100*a(n-2) for n > 3.
G.f.: 10*x*(1 - 2*x + 10*x^2) / (1-10*x)^2.
(End)
From Bernard Schott, Nov 14 2022: (Start)
a(n) = A212704(n) for n > 1.
a(n) = 9 * A053541(n) for n > 1.
a(n) = 9 * A081045(n-1) + A212704(n-1), for n > 1 (means a(n) = number of nonzero digits + number of zero digits). (End)
E.g.f.: x*(1 + 9*exp(10*x)). - Stefano Spezia, Dec 24 2022

Extensions

More terms from Joshua Zucker, May 08 2006
a(17) corrected by Colin Barker, Aug 05 2016