OFFSET
0,2
COMMENTS
First differences of 9^n - 8^n = A016185.
a(n-1) is the number of numbers with n digits having the largest digit equal to 8. Note that this is independent of the base b > 8.
Equivalently, number of n-letter words over a 9-letter alphabet, which must not start with the last letter of the alphabet, and in which the first letter of the alphabet must appear.
LINKS
FORMULA
G.f.: (1-x)/((1-8*x)*(1-9*x)). - Vincenzo Librandi, May 04 2015
E.g.f.: exp(8*x)*(8*exp(x) - 7). - Stefano Spezia, Nov 15 2023
MATHEMATICA
Table[8 9^n - 7 8^n, {n, 0, 20}] (* Vincenzo Librandi, May 04 2015 *)
LinearRecurrence[{17, -72}, {1, 16}, 30] (* Harvey P. Dale, May 26 2019 *)
PROG
(PARI) a(n)=8*9^n-7*8^n
(Magma) [8*9^n-7*8^n: n in [0..20]]; // Vincenzo Librandi, May 04 2015
(Sage) [8*9^n-7*8^n for n in (0..20)] # Bruno Berselli, May 04 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, May 03 2015
STATUS
approved