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)
Index entries for linear recurrences with constant coefficients, signature (99,-810).
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
KEYWORD
nonn,base,easy
AUTHOR
Bernard Schott, Dec 04 2012
STATUS
approved