Sum of first N Star Numbers | Function to find the sum of the first N star number ; Variable to store the sum ; Driver code
def sum_star_num ( n ) : NEW_LINE INDENT summ = 2 * n * ( n + 1 ) * ( n - 1 ) + n NEW_LINE return summ NEW_LINE DEDENT n = 3 NEW_LINE print ( sum_star_num ( n ) ) NEW_LINE