human
Sum of first n terms of a given series 3 , 6 , 11 , ... . . | Function to calculate the sum.
starting number.
common ratio of GP.
common difference Of AP.
no . of the terms for the sum.
Find the Sn"
How can the above be solved in Python?

=====
Give me a code to sum of first n terms of a given series 3 , 6 , 11 ,?
assistant
#Here is code to sum of first n terms of a given series 3 , 6 , 11 , .
 def calculateSum ( n ) :
	a1 = 1 ;
	a2 = 2 ;
	r = 2 ;
	d = 1 ;
	return ( ( n ) * ( 2 * a1 + ( n - 1 ) * d ) / 2 + a2 * ( pow ( r , n ) - 1 ) / ( r - 1 ) ) ;
n = 5 ;
print ( " Sum ▁ = " , int ( calculateSum ( n ) ) )