Program to find Nth term of series 2 , 12 , 28 , 50 , 77 , 112 , 152 , 198 , ... . . | calculate Nth term of series ; Driver code
function nthTerm ( n ) { return 3 * Math . pow ( n , 2 ) + n - 2 ; } let N = 4 ; document . write ( nthTerm ( N ) ) ;