Find m | Function to return mth summation ; base case ; driver program
function SUM ( n , m ) { if ( m == 1 ) return ( n * ( n + 1 ) / 2 ) ; let sum = SUM ( n , m - 1 ) ; return ( sum * ( sum + 1 ) / 2 ) ; } let n = 5 ; let m = 3 ; document . write ( " " + n + " " + m + " " + SUM ( n , m ) ) ;