Program to print the series 2 , 15 , 41 , 80 , 132 , 197 … till N terms | C ++ implementation to print the given with the given Nth term ; Function to print the series ; Generate the ith term and ; Driver Code
#include " bits / stdc + + . h " NEW_LINE using namespace std ; void printSeries ( int N ) { int ith_term = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { ith_term = ( 13 * i * ( i - 1 ) ) / 2 + 2 ; cout << ith_term << " , ▁ " ; } } int main ( ) { int N = 7 ; printSeries ( N ) ; return 0 ; }