%I #29 Jan 01 2021 12:47:23
%S 10,99,981,9720,96309,954261,9455130,93684519,928256841,9197472240,
%T 91131561729,902961305721,8946835807050,88648174014939,
%U 878355088397901,8703029361715560,86232460051021149,854419404714630381,8465866782890863770
%N Number of decimal strings of length n that do not contain a specific string xx (where x is a single digit).
%C See A322053 for the number that do contain the specified string.
%H Robert P. P. McKone, <a href="/A322054/b322054.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (9,9).
%F G.f. = x*(10+9*x)/(1-9*x-9*x^2).
%F a(n) = 9*a(n-1)+9*a(n-2) for n >= 3.
%e Suppose the string is 00. At length 2 there are 99 strings that do not contain it. At length 3 there are 19 strings that do not contain it, 000, 00x, and x00, where x is any nonzero digit. So a(3) = 1000-19 = 981.
%t T[n_, k_] := LinearRecurrence[{n - 1, n - 1}, {n, n^2 - 1}, k];
%t T[10, {1, 19}] (* _Robert P. P. McKone_, Dec 31 2020 *)
%Y Cf. A322052, A004189, A322053.
%Y Suggested by A322628.
%K nonn,base
%O 1,1
%A _N. J. A. Sloane_, Dec 21 2018
|