Program to find the Nth term of the series 0 , 14 , 40 , 78 , 124 , ... | calculate sum upto Nth term of series ; return the final sum ; Driver code
function nthTerm ( n ) { return 6 * Math . pow ( n , 2 ) - 4 * n - 2 ; } let N = 4 ; document . write ( nthTerm ( N ) ) ;