login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A113119
Total number of digits in all n-digit nonnegative integers.
5
10, 180, 2700, 36000, 450000, 5400000, 63000000, 720000000, 8100000000, 90000000000, 990000000000, 10800000000000, 117000000000000, 1260000000000000, 13500000000000000, 144000000000000000, 1530000000000000000, 16200000000000000000, 171000000000000000000
OFFSET
1,1
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
EXAMPLE
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.
MATHEMATICA
LinearRecurrence[{20, -100}, {10, 180, 2700}, 20] (* Harvey P. Dale, Dec 09 2021 *)
PROG
(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
CROSSREFS
Essentially the same as A212704.
Sequence in context: A057122 A261177 A367986 * A067416 A113671 A001762
KEYWORD
base,easy,nonn
AUTHOR
Alexandre Wajnberg, Jan 03 2006
EXTENSIONS
More terms from Joshua Zucker, May 08 2006
a(17) corrected by Colin Barker, Aug 05 2016
STATUS
approved