Sum of first N Star Numbers | Function to find the sum of the first N star number ; Variable to store the sum ; Driver code
function sum_star_num ( n ) { let summ = 2 * n * ( n + 1 ) * ( n - 1 ) + n ; return summ ; } let n = 3 ; document . write ( sum_star_num ( n ) ) ;