human
Sum of the first N terms of the series 5 , 12 , 23 , 38. ... | Function to calculate the sum.
Driver code.
number of terms to be included in sum.
find the Sn"
Solution in Python:
assistant
#Here is code to sum of the first N terms of the series 5 , 12 , 23 , 38.
 def calculateSum ( n ) :
	return ( 2 * ( n * ( n + 1 ) * ( 2 * n + 1 ) // 6 ) + n * ( n + 1 ) // 2 + 2 * ( n ) )
if __name__ == " _ _ main _ _ " :
	n = 3
	print ( " Sum ▁ = " , calculateSum ( n ) )