login
a(n) is the number of weak compositions of n into n-1 parts in which at least one part is zero.
3

%I #21 Mar 06 2022 09:02:34

%S 0,2,12,52,205,786,2996,11432,43749,167950,646635,2496132,9657687,

%T 37442146,145422660,565722704,2203961413,8597496582,33578000591,

%U 131282408380,513791607399,2012616400058,7890371113927,30957699535752,121548660036275

%N a(n) is the number of weak compositions of n into n-1 parts in which at least one part is zero.

%F a(n) = binomial(2*n-2,n) - (n-1) = A001791(n-1) -n+1.

%F G.f.: 4*x^2/((1 - sqrt(1 - 4*x))^2*sqrt(1 - 4*x)) - (1 - 2*x + 2*x^2)/(1 - x)^2. - _Stefano Spezia_, Jan 10 2022

%F D-finite with recurrence +n*(11*n-38)*a(n) -(n-1)*(73*n-244)*a(n-1) +2*(67*n^2-364*n+492)*a(n-2) -4*(9*n-22)*(2*n-7)*a(n-3)=0. - _R. J. Mathar_, Mar 06 2022

%e a(5)=52 since 5 can be written as 5+0+0+0 (4 such compositions); 4+1+0+0 (12 such compositions); 3+2+0+0 (12 such compositions); 3+1+1+0 (12 such compositions); 2+2+1+0 (12 such compositions). All these weak compositions contain at least one zero.

%t a[n_] := Binomial[2*n - 2, n] - n + 1; Array[a, 25, 2] (* _Amiram Eldar_, Jan 10 2022 *)

%Y Cf. A001791, A010763.

%K nonn,easy

%O 2,2

%A _Enrique Navarrete_, Jan 09 2022