Sum of product of consecutive Binomial Coefficients | Javascript Program to find sum of product of consecutive Binomial Coefficient . ; Find the binomial coefficient upto nth term ; C [ 0 ] = 1 ; nC0 is 1 ; Compute next row of pascal triangle using the previous row ; Return the sum of the product of consecutive binomial coefficient . ; finding the sum of product of consecutive coefficient . ; Driven Program
var MAX = 100 ; function binomialCoeff ( C , n ) { for ( var i = 1 ; i <= n ; i ++ ) { for ( var j = Math . min ( i , n ) ; j > 0 ; j -- ) C [ j ] = C [ j ] + C [ j - 1 ] ; } } function sumOfproduct ( n ) { var sum = 0 ; var C = Array ( MAX ) . fill ( 0 ) ; binomialCoeff ( C , n ) ; for ( var i = 0 ; i <= n ; i ++ ) sum += C [ i ] * C [ i + 1 ] ; return sum ; } var n = 3 ; document . write ( sumOfproduct ( n ) ) ;