Sum of sum | Function to find the sum ; Calculate sum - series for every natural number and add them ; Driver code
function sumOfSumSeries ( N ) { let sum = 0 ; for ( let i = 1 ; i <= N ; i ++ ) { sum = sum + ( i * ( i + 1 ) ) / 2 ; } return sum ; } let N = 5 ; document . write ( sumOfSumSeries ( N ) ) ;