n | C # program to find the n - th term in series ; Function to find nth term ; Driver Code
using System ; class Series { static int sumOfSeries ( int n ) { return n * ( n + 1 ) * ( 6 * n * n * n + 9 * n * n + n - 1 ) / 30 ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( sumOfSeries ( n ) ) ; } }