human
Give me a code to find the sum of the first Nth Centered Hexadecagonal Number and the other steps required given the following:
Find the sum of the first Nth Centered Hexadecagonal Number | Centered_Hexadecagonal number function.
Formula to calculate nth Centered_Hexadecagonal number & return it into main function ..
Function to find the sum of the first N Centered Hexadecagonal number.
Variable to store the sum.
Loop to iterate through the first N numbers.
Find the sum.
Driver Code.
display first Nth Centered_Hexadecagonal number"
Solution in Python:
assistant
#Here is code to find the sum of the first Nth Centered Hexadecagonal Number and the other steps required.
 def Centered_Hexadecagonal_num ( n ) :
	return ( 8 * n * n - 8 * n + 1 )
def sum_Centered_Hexadecagonal_num ( n ) :
	summ = 0
	for i in range ( 1 , n + 1 ) :
		summ += Centered_Hexadecagonal_num ( i )
	return summ
if __name__ == ' _ _ main _ _ ' :
	n = 5
	print ( sum_Centered_Hexadecagonal_num ( n ) )