human
Pentagonal Pyramidal Number | function to get nth Pentagonal pyramidal number ..
Running loop from 1 to n.
get nth pentagonal number.
add to sum.
Driver Program"
How can the above be solved in Python?
 Give me a code to pentagonal Pyramidal Number and the other steps required?
assistant
#Here is code to pentagonal Pyramidal Number and the other steps required.
 def pentagon_pyramidal ( n ) :
	sum = 0
	for i in range ( 1 , n + 1 ) :
		p = ( 3 * i * i - i ) / 2
		sum = sum + p
	return sum
n = 4
print ( int ( pentagon_pyramidal ( n ) ) )