Find Nth term of the series 1 , 6 , 18 , 40 , 75 , ... . | Function to generate a fixed number ; ( N ^ 2 * ( N + 1 ) ) / 2 ; Driver Method
function nthTerm ( N ) { let nth = 0 ; nth = parseInt ( ( N * N * ( N + 1 ) ) / 2 ) ; return nth ; } let N = 5 ; document . write ( nthTerm ( N ) ) ;