Sum of series 1 * 1 * 2 ! + 2 * 2 * 3 ! + …… . . + n * n * ( n + 1 ) ! | java script program to find sum of the series . ; Function to calculate required series ; Drivers code
function factorial ( n ) { let res = 1 ; for ( let i = 2 ; i <= n ; i ++ ) res = res * i ; return res ; } function calculateSeries ( n ) { return 2 + ( n * n + n - 2 ) * factorial ( n + 1 ) ; } let n = 3 ; document . write ( calculateSeries ( n ) ) ;