A367246 a(n) is the number of n-digit numbers whose difference between the largest and smallest digits is equal to 5.
0, 9, 139, 1419, 12079, 92859, 669319, 4617699, 30878959, 201792939, 1295974999, 8212422579, 51499341439, 320287850619, 1978857202279, 12161478061059, 74421280021519, 453832688077899, 2759692966903159, 16742329188365139, 101377580843991199, 612894508749226779, 3700556151386869639
Offset: 1
Links
- Index entries for linear recurrences with constant coefficients, signature (15,-74,120).
Crossrefs
Programs
-
Mathematica
LinearRecurrence[{15,-74,120},{0,9,139},23]
Formula
a(n) = 29*6^(n-1) - 49*5^(n-1) + 5*4^n.
a(n) = 15*a(n-1) - 74*a(n-2) + 120*a(n-3) for n > 3.
O.g.f.: x^2*(9 + 4*x)/((1 - 4*x)*(1 - 5*x)*(1 - 6*x)).
E.g.f.: (145*exp(6*x) - 294*exp(5*x) + 150*exp(4*x) - 1)/30.
Comments