OFFSET
0,2
COMMENTS
First differences of 5^n - 4^n = A005060.
a(n-1) is the number of numbers with n digits having the largest digit equal to 4. Note that this is independent of the base b>4. Equivalently, number of n-letter words over a 5-letter alphabet {a,b,c,d,e}, which must not start with the first letter of the alphabet, and in which the last letter of the alphabet must appear.
LINKS
FORMULA
From Vincenzo Librandi, May 04 2015: (Start)
G.f.: (1-x)/((1-4*x)*(1-5*x)).
a(n) = 9*a(n-1) - 20*a(n-2). - (End)
E.g.f.: exp(4*x)*(4*exp(x) - 3). - Stefano Spezia, Nov 15 2023
MATHEMATICA
Table[4 5^n - 3 4^n, {n, 0, 30}] (* Vincenzo Librandi, May 04 2015 *)
PROG
(PARI) a(n)=4*5^n-3*4^n
(Magma) [4*5^n-3*4^n: n in [0..30]]; // Vincenzo Librandi, May 04 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, May 03 2015
STATUS
approved