%I #9 Jun 03 2025 01:00:54
%S 0,0,0,1,13,106,694,3991,21067,104680,497452,2285053,10222777,
%T 44788342,192970834,820244467,3448381783,14367483412,59421385000,
%U 244271688313,999169721125,4070288777410,16525230017710,66906367267471,270271938430243
%N a(n) = 4^n - 3^n - n*3^(n-1) - binomial(n,2)*3^(n-2).
%C a(n) is the number of strings of length n defined on {0, 1, 2, 3} that contain at least three 0's.
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (13,-63,135,-108).
%F E.g.f.: exp(3*x)*(exp(x) - x^2/2 - x - 1).
%F G.f.: x^3/((1 - 3*x)^3*(1 - 4*x)). - _Stefano Spezia_, May 29 2025
%e a(4) = 13 since the strings are the 4 permutations of 0001, the 4 permutations of 0002, the 4 permutations of 0003 and 0000.
%t a[n_]:=4^n - 3^n - n*3^(n-1) - Binomial[n,2]*3^(n-2); Array[a,25,0] (* _Stefano Spezia_, May 29 2025 *)
%Y Cf. A086443, A345954.
%K nonn,easy
%O 0,5
%A _Enrique Navarrete_, May 28 2025