OFFSET
1,4
COMMENTS
a(n) is the number of ways to place n indistinguishable balls into n distinguishable boxes with at least 3 boxes remaining empty.
a(n) is also the number of weak compositions of n into n parts in which at least three parts are zero.
EXAMPLE
a(5)=45 since 5 can be written as 5+0+0+0+0, 0+5+0+0+0, etc. (5 such compositions); 4+1+0+0+0 (20 such compositions); 3+2+0+0+0 (20 such compositions).
MATHEMATICA
Table[Binomial[2n-1, n]-Binomial[n, 2]*(Binomial[n-1, 2]+2)-1, {n, 27}] (* James C. McMahon, Mar 08 2024 *)
PROG
(Python)
from math import comb
def A371003(n): return comb((n<<1)-1, n)-n-((m:=(n-1)**2)*(m+3)>>2) # Chai Wah Wu, Mar 29 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Enrique Navarrete, Mar 07 2024
STATUS
approved