Product of N terms of a given Geometric series | Function to calculate product of geometric series ; Return the final product with the above formula ; Given first term and common ratio ; Number of terms ; Function Call
function productOfGP ( a , r , n ) { return Math . pow ( a , n ) * Math . pow ( r , n * ( n - 1 ) / 2 ) ; } let a = 1 , r = 2 ; let N = 4 ; document . write ( productOfGP ( a , r , N ) ) ;