%I #5 Nov 12 2023 13:31:47
%S 0,3,79,1323,18175,223323,2555119,27828363,292407775,2990349243,
%T 29943991759,294872615403,2864776362175,27525734996763,
%U 262061152909999,2475899571994443,23240879960425375,216963121865909883,2015960236625789839,18656492902684557483,172056837889322101375
%N a(n) is the number of n-digit numbers whose difference between the largest and smallest digits is equal to 8.
%C a(n) is the number of n-digit numbers in A366965.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (24,-191,504).
%F a(n) = 17*9^(n-1) - 31*8^(n-1) + 2*7^n.
%F a(n) = 24*a(n-1) - 191*a(n-2) + 504*a(n-3) for n > 3.
%F O.g.f.: x^2*(3 + 7*x)/((1 - 7*x)*(1 - 8*x)*(1 - 9*x)).
%F E.g.f.: (136*exp(9*x) - 279*exp(8*x) + 144*exp(7*x) - 1)/72.
%t LinearRecurrence[{24,-191,504},{0,3,79},21]
%Y Cf. A366965.
%Y Cf. A000420, A001018, A001019.
%Y Cf. A367243, A367244, A367245, A367246, A367247, A367248, A367250.
%K nonn,base,easy
%O 1,2
%A _Stefano Spezia_, Nov 11 2023
|