Sum of first N Star Numbers | C # program to find the sum of the first N star numbers ; Function to find the sum of the first N star number ; Variable to store the sum ; Driver code
using System ; class GFG { static int sum_star_num ( int n ) { int summ = 2 * n * ( n + 1 ) * ( n - 1 ) + n ; return summ ; } public static void Main ( String [ ] args ) { int n = 3 ; Console . WriteLine ( sum_star_num ( n ) ) ; } }