Sum of n - 1 terms starting from 2 nd term
let i ; for ( i = 1 ; i < n ; i ++ ) { fct = 1 ; for ( j = 1 ; j <= y ; j ++ ) { fct = fct * j ; } term = term * ( - 1 ) ; m = term * Math . pow ( x , y ) / fct ; sum = sum + m ; y += 2 ; } return sum ; }