login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A220094
Sum of the n-digit base-ten numbers whose digits are nonzero.
2
45, 4455, 404595, 36446355, 3280467195, 295244704755, 26572047342795, 2391484476085155, 215233604784766395, 19371024448062897555, 1743392200482566077995, 156905298044843094701955, 14121476824048587852317595, 1270932914164487290670858355
OFFSET
1,1
COMMENTS
For n >= 1, a(n) is the sum of the numbers with n digits in base ten whose digits belong to the set {1,2,3,4,5,6,7,8,9}.
If E_n is the set of the numbers with n digits in base ten whose digits belong to {1,2,3,4,5,6,7,8,9}, then card(E_n) = 9^n (see A001019).
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)
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)
EXAMPLE
For n=2, in base ten, a(2) = 11+12+...+19+21+...+89+91+...+98+99 = 4455.
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 *)
PROG
(PARI) a(n)=5*9^(n-1)*(10^n-1) \\ Charles R Greathouse IV, Jul 06 2017
CROSSREFS
Sequence in context: A113630 A143004 A004707 * A274603 A036521 A328356
KEYWORD
nonn,base,easy
AUTHOR
Bernard Schott, Dec 04 2012
STATUS
approved