cp's OEIS Frontend

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.

A338229 Number of ternary strings of length n that contain at least one 0 and at most two 1's.

This page as a plain text file.
%I A338229 #20 Mar 23 2022 19:42:22
%S A338229 0,1,5,19,61,176,474,1219,3035,7378,17608,41405,96177,221092,503702,
%T A338229 1138567,2555767,5701478,12648276,27918145,61341485,134217496,
%U A338229 292552450,635436779,1375731411,2969566906,6392118944,13723762309,29393682025,62813896268,133949292078,285078453775,605590388207
%N A338229 Number of ternary strings of length n that contain at least one 0 and at most two 1's.
%H A338229 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (9,-33,63,-66,36,-8).
%F A338229 a(n) = 2^n + n*2^(n-1) + binomial(n,2)*2^(n-2) - binomial(n,2) - n - 1.
%F A338229 E.g.f.: exp(x)*(exp(x) - 1)*(2 + 2*x + x^2)/2.
%F A338229 G.f.: x*(1 - 4*x + 7*x^2 - 8*x^3 + 5*x^4)/(1 - 3*x + 2*x^2)^3. - _Stefano Spezia_, Jan 31 2021
%e A338229 a(3) = 19 since the strings are composed of 000, the 6 permutations of 012, and the 3 permutations of 001, 002, 011 and 022. The total number of strings is then 1 + 6 + 3 + 3 + 3 + 3 = 19.
%t A338229 CoefficientList[Series[Exp[x](Exp[x]-1)(2+2x+x^2)/2,{x,0,32}],x]Table[i!,{i,0,32}] (* _Stefano Spezia_, Jan 31 2021 *)
%t A338229 LinearRecurrence[{9,-33,63,-66,36,-8},{0,1,5,19,61,176},40] (* _Harvey P. Dale_, Mar 23 2022 *)
%Y A338229 Cf. A338230, A338232.
%K A338229 nonn,easy
%O A338229 0,3
%A A338229 _Enrique Navarrete_, Jan 30 2021