Program to find Nth term of series 1 , 6 , 17 , 34 , 56 , 86 , 121 , 162 , ... ... . | calculate Nth term of series ; Driver code
function nthTerm ( n ) { return 3 * Math . pow ( n , 2 ) - 4 * n + 2 ; } let N = 4 ; document . write ( nthTerm ( N ) ) ;