%I #7 Nov 12 2023 13:30:39
%S 0,15,91,381,1375,4605,14791,46341,142975,436845,1326391,4010901,
%T 12096175,36415485,109500391,329009061,988042975,2966160525,
%U 8902544791,26715760821,80163535375,240523111965,721634347591,2165033066181,6495359245375,19486597829805,58460833676791
%N a(n) is the number of n-digit numbers whose difference between the largest and smallest digits is equal to 2.
%C a(n) is the number of n-digit numbers in A366959.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (6,-11,6).
%F a(n) = (46*3^n - 93*2^n + 48)/6.
%F a(n) = 6*a(n-1) - 11*a(n-2) + 6*a(n-3) for n > 3.
%F O.g.f.: x^2*(15 + x)/((1 - x)*(1- 2*x)*(1 - 3*x)).
%F E.g.f.: (exp(x) - 1)^2*(46*exp(x) - 1)/6.
%t LinearRecurrence[{6,-11,6},{0,15,91},27]
%Y Cf. A366959.
%Y Cf. A000079, A000244.
%Y Cf. A367244, A367245, A367246, A367247, A367248, A367249, A367250.
%K nonn,base,easy
%O 1,2
%A _Stefano Spezia_, Nov 11 2023
|