Sum[Binomial[40, n]*(1/1000)^(n−1)*(999!/((999−40+n)!*1000^(999−40+n))), {n, 2, 39}]