Print the first N terms of the series 6 , 28 , 66 , 120 , 190 , 276 , ... | C # program for the above approach ; 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 ; Driver code ; Given number N ; Function call
using System ; class GFG { static void printSeries ( int n ) { int k = 2 ; for ( int i = 0 ; i < n ; i ++ ) { Console . Write ( k * ( 2 * k - 1 ) + " ▁ " ) ; k += 2 ; } Console . WriteLine ( ) ; } public static void Main ( ) { int N = 12 ; printSeries ( N ) ; } }