Program to print the series 2 , 15 , 41 , 80 , 132 , 197 … till N terms | Function to print the series ; Generate the ith term and ; Driver Code
function printSeries ( N ) { let ith_term = 0 ; for ( let i = 1 ; i <= N ; i ++ ) { ith_term = ( 13 * i * ( i - 1 ) ) / 2 + 2 ; document . write ( ith_term + " " ) ; } } let N = 7 ; printSeries ( N ) ;