login
Number of hexadecimal strings of length n that contain a specific string xx (where x is a single digit).
5

%I #9 May 18 2026 01:10:00

%S 0,0,1,31,736,15601,310591,5941456,110557921,2015926111,36192227776,

%T 641841785041,11270021820031,196270140120496,3394577405818561,

%U 58366312816456351,998470947372051616,17005480407434466481,288506014395807323071,4877820327227979669136,82217261607226450096801

%N Number of hexadecimal strings of length n that contain a specific string xx (where x is a single digit).

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

%F a(n) = A340156(16,n).

%F a(n) = 16^n - A395832(n).

%F G.f.: x^2 / ((16*x-1) * (15*x^2 + 15*x - 1)). - _Amiram Eldar_, May 14 2026

%F E.g.f.: exp(16*x) - exp(15*x/2)*(285*cosh(sqrt(285)*x/2) + 17*sqrt(285)*sinh(sqrt(285)*x/2))/285. - _Stefano Spezia_, May 14 2026

%t LinearRecurrence[{31, -225, -240}, {0, 0, 1}, 21] (* _Amiram Eldar_, May 14 2026 *)

%Y Cf. A340156, A395832.

%Y Cf. A008466, A186244, A351529, A351530, A395827, A395828, A322053, A395829.

%K nonn,easy

%O 0,4

%A _A.H.M. Smeets_, May 13 2026