So if you have Pascal's triangle, I know you can calculate any value in closed form.
1
1 1
1 2 1
1 3 3 1
....
If we let R
be the row number, then we can generate that triangle like this
C(R,0)
C(R,0) C(R,1)
C(R,0) C(R,1) C(R,2)
C(R,0) C(R,1) C(R,2) CR,3)
with the choose function Choose(row#,column#)
but I have a variation on this that looks like this
C(R,0)*C(N,0)
C(R,0)*C(N,0) C(R,1)*C(N,1)
C(R,0)*C(N,0) C(R,1)*C(N,1) C(R,2)*C(N,2)
C(R,0)*C(N,0) C(R,1)*C(N,1) C(R,2)*C(N,2) C(R,2)*C(N,3)
....
So at point in Pascals triangle instead of C(N,Column#)
you have C(R,Column#)*C(N,Column#)
. Where R > Column#
.
So we can calculate any single value in closed form, but if I wanted to calculate a whole row or subset of a row, is there a closed form for that?
To my knowledge there is no [known] closed-form formula to your problem (this link gives a bound to a similar problem: https://mathoverflow.net/questions/17202/sum-of-the-first-k-binomial-coefficients-for-fixed-n).
But we know that $\sum_{k=0}^{n} {n \choose k} = 2^n$, so if your interval is large, you can deduce the sum of the terms that you don't want to $2^n$ and compute the answer more quickly.
[Also, you can use the fact that the triangle is symmetric to speed up computation, by only considering one side and multiplying it by 2 (plus the middle term, if the row has an odd number of terms)]