Program to find the Nth term of series 5 , 10 , 17 , 26 , 37 , 50 , 65 , 82 , ... | calculate Nth term of series ; return the final sum ; Driver code
function nthTerm ( n ) { return Math . pow ( n , 2 ) + 2 * n + 2 ; } let N = 4 ; document . write ( nthTerm ( N ) ) ;