human
What is a code to find the sum of the first N Centered Pentagonal Number and the other steps required given the following:
Find the sum of the first N Centered Pentagonal Number | Function to find the Centered_Pentagonal number.
Formula to calculate nth Centered_Pentagonal number & return it into main function ..
Function to find the sum of the first N Centered_Pentagonal numbers.
To get the sum.
Function to get the Centered_Pentagonal_num.
Driver Code.
display first Nth Centered_Pentagonal number"
How can the above be solved in Python?
assistant
#Here is code to find the sum of the first N Centered Pentagonal Number and the other steps required.
 def Centered_Pentagonal_num ( n ) :
	return ( 5 * n * n - 5 * n + 2 ) // 2
def sum_Centered_Pentagonal_num ( n ) :
	summ = 0
	for i in range ( 1 , n + 1 ) :
		summ += Centered_Pentagonal_num ( i )
	return summ
if __name__ == ' _ _ main _ _ ' :
	n = 5
	print ( sum_Centered_Pentagonal_num ( n ) )