Print the first N terms of the series 6 , 28 , 66 , 120 , 190 , 276 , ... | Function to print the series ; Initialise the value of k with 2 ; Iterate from 1 to n ; Print each number ; Increment the value of K by 2 for next number ; Given number ; Function Call
def PrintSeries ( n ) : NEW_LINE INDENT k = 2 NEW_LINE for i in range ( 0 , n ) : NEW_LINE INDENT print ( k * ( 2 * k - 1 ) , end = ' ▁ ' ) NEW_LINE k = k + 2 NEW_LINE DEDENT DEDENT n = 12 NEW_LINE PrintSeries ( n ) NEW_LINE