OFFSET
1,3
COMMENTS
a(n) is the number of ways to place n indistinguishable balls into n distinguishable boxes with at least 2 boxes remaining empty.
a(n) is also the number of weak compositions of n into n parts in which at least two parts are zero.
FORMULA
G.f.: 2*x/(4*x - 1 + sqrt(1 - 4*x)) - (1 - 2*x + 3*x^2)/(1 - x)^3. - Stefano Spezia, Mar 01 2022
D-finite with recurrence n*a(n) +2*(-3*n+2)*a(n-1) +(9*n-14)*a(n-2) +2*(-2*n+5)*a(n-3) +2*(-9*n+22)=0. - R. J. Mathar, Jan 25 2023
EXAMPLE
a(4)=22 since 4 can be written as 3+1+0+0, 0+3+0+1, etc. (12 such compositions); 2+2+0+0 (6 such compositions); 4+0+0+0 (4 such compositions).
MATHEMATICA
Table[Binomial[2n-1, n]-n(n-1)-1, {n, 40}] (* Harvey P. Dale, Dec 03 2022 *)
PROG
(PARI) a(n) = binomial(2*n-1, n) - n*(n-1) - 1; \\ Michel Marcus, Apr 12 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Enrique Navarrete, Feb 28 2022
STATUS
approved