A220094 Sum of the n-digit base-ten numbers whose digits are nonzero.
45, 4455, 404595, 36446355, 3280467195, 295244704755, 26572047342795, 2391484476085155, 215233604784766395, 19371024448062897555, 1743392200482566077995, 156905298044843094701955, 14121476824048587852317595, 1270932914164487290670858355
Offset: 1
Examples
For n=2, in base ten, a(2) = 11+12+...+19+21+...+89+91+...+98+99 = 4455.
References
- A. Ducos, Eléments fondamentaux de Math Sup, Ellipses, 1994, exercice 9, p. 126.
Links
- Bernard Schott and Raymond Cordier, Question Comtet 16 (French mathematical forum les-mathematiques.net)
- Index entries for linear recurrences with constant coefficients, signature (99,-810).
Programs
-
Maple
:= n->5*9^(n-1)*(10^n-1);
-
Mathematica
Table[5*9^(n - 1)*(10^n - 1), {n, 20}] (* T. D. Noe, Dec 31 2012 *)
-
PARI
a(n)=5*9^(n-1)*(10^n-1) \\ Charles R Greathouse IV, Jul 06 2017
Formula
a(n) = 5*9^(n-1)*(10^n-1).
Generalization to base b with n-digit numbers whose digits belong to {1,2,...,b-1}: a_b(n) = (b/2)*(b-1)^(n-1)*(b^n-1).
From Colin Barker, Jan 04 2013: (Start)
a(n) = 99*a(n-1) - 810*a(n-2).
G.f.: 45*x/((9*x-1)*(90*x-1)). (End)
Comments