login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the number of n-digit numbers whose difference between the largest and smallest digits is equal to 6.
7

%I #5 Nov 12 2023 13:31:31

%S 0,7,131,1609,16415,150817,1296191,10641169,84520175,654958177,

%T 4980233951,37312922929,276288797135,2026564724737,14750977566911,

%U 106695818055889,767748717541295,5500729672814497,39270143125479071,279511731951144049,1984459091985376655,14059238393314971457

%N a(n) is the number of n-digit numbers whose difference between the largest and smallest digits is equal to 6.

%C a(n) is the number of n-digit numbers in A366963.

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (18,-107,210).

%F a(n) = 27*7^(n-1) - 47*6^(n-1) + 4*5^n.

%F a(n) = 21*a(n-1) - 146*a(n-2) + 336*a(n-3) for n > 3.

%F O.g.f.: x^2*(7 + 5*x)/((1 - 5*x)*(1 - 6*x)*(1 - 7*x)).

%F E.g.f.: (162*exp(7*x) - 329*exp(6*x) + 168*exp(5*x) - 1)/42.

%t LinearRecurrence[{18,-107,210},{0,7,131},22]

%Y Cf. A366963.

%Y Cf. A000351, A000400, A000420.

%Y Cf. A367243, A367244, A367245, A367246, A367248, A367249, A367250.

%K nonn,base,easy

%O 1,2

%A _Stefano Spezia_, Nov 11 2023