login
A367250
a(n) is the number of n-digit numbers whose difference between the largest and smallest digits is equal to 9.
7
0, 1, 35, 703, 11231, 158311, 2062655, 25466743, 302423471, 3487593511, 39314599775, 435241463383, 4748453693711, 51186327429511, 546278900354495, 5781325731101623, 60750456603203951, 634502309615150311, 6592506388026870815, 68188442304165981463, 702543059232886986191
OFFSET
1,3
COMMENTS
a(n) is the number of n-digit numbers in A366966.
FORMULA
a(n) = 9*10^(n-1) - 17*9^(n-1) + 8^n.
a(n) = 27*a(n-1) - 242*a(n-2) + 720*a(n-3) for n > 3.
O.g.f.: x^2*(1 + 8*x)/((1 - 8*x)*(1 - 9*x)*(1 - 10*x)).
E.g.f.: (81*exp(10*x) - 170*exp(9*x) + 90*exp(8*x) - 1)/90.
MATHEMATICA
LinearRecurrence[{27, -242, 720}, {0, 1, 35}, 21]
KEYWORD
nonn,base,easy
AUTHOR
Stefano Spezia, Nov 11 2023
STATUS
approved