This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A338230 #19 Feb 15 2021 23:04:23 %S A338230 0,0,1,7,27,81,213,519,1207,2725,6033,13179,28515,61257,130861,278287, %T A338230 589551,1244877,2621097,5504643,11533915,24116785,50331141,104857047, %U A338230 218103207,452984181,939523393,1946156299,4026531027,8321498265,17179868253,35433479199,73014442975,150323854237 %N A338230 Number of ternary strings of length n that contain at least two 0's and at most one 1. %H A338230 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (7,-19,25,-16,4). %F A338230 a(n) = 2^n + n*2^(n-1) - 2*binomial(n,2) - 2*n - 1. %F A338230 E.g.f.: exp(x)*(exp(x) - 1 - x)*(1 + x). %F A338230 G.f.: x^2*(1 - 3*x^2)/((1 - 2*x)^2*(1 - x)^3). - _Stefano Spezia_, Jan 31 2021 %e A338230 a(4) = 27 since the strings consist of 0000, the 4 permutations of 0001, the 4 permutations of 0002, the 6 permutations of 0022, and the 12 permutations of 0012. The total number of strings is then 1 + 4 + 4 + 6 + 12 = 27. %t A338230 CoefficientList[Series[Exp[x](Exp[x]-1-x)(1+x),{x,0,32}],x]Table[i!,{i,0,32}] (* _Stefano Spezia_, Jan 31 2021 *) %Y A338230 Cf. A186244, A186314. %Y A338230 Cf. A338229, A338232. %K A338230 nonn,easy %O A338230 0,4 %A A338230 _Enrique Navarrete_, Jan 30 2021