Program to print the series 1 , 9 , 17 , 33 , 49 , 73 , 97. . . till N terms | Function to print the series ; Generate the ith term and print it ; Driver Code
function printSeries ( N ) { let ith_term = 0 ; for ( let i = 1 ; i <= N ; i ++ ) { ith_term = i % 2 == 0 ? 2 * i * i + 1 : 2 * i * i - 1 ; document . write ( ith_term + " " ) ; } } let N = 7 ; printSeries ( N ) ;