login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = n*(2^(n-1) - n - 1).
1

%I #12 Apr 05 2021 04:11:43

%S 0,12,50,150,392,952,2214,5010,11132,24420,53066,114478,245520,524016,

%T 1113806,2358954,4980356,10485340,22019634,46136838,96468440,

%U 201325992,419429750,872414530,1811938572,3758095572,7784627354,16106126430,33285995552,68719475680

%N a(n) = n*(2^(n-1) - n - 1).

%C a(n) is the number of ternary strings of length n with at least one 0, at least two 1's, and one 2.

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (7,-19,25,-16,4).

%F G.f.: 2*x^4*(6 - 17*x + 14*x^2 - 4*x^3)/((1 - x)^3*(1 - 2*x)^2). - _Stefano Spezia_, Mar 14 2021

%e a(6)=150 since the strings are the 30 permutations of 201111, the 60 permutations of 200111 and the 60 permutations of 200011.

%t Array[# (2^(# - 1) - # - 1) &, 30, 3] (* _Michael De Vlieger_, Mar 13 2021 *)

%K nonn,easy

%O 3,2

%A _Enrique Navarrete_, Mar 13 2021