Problem 5 Write a function to compute the sum of a geometric
Problem #5. Write a function to compute the sum of a geometric series
1 + r + r2 + r3 +
Solution
The sum of geometric series here has the first term a=1 and common ratio r
Hence Sn = Sum of n terms
= , if |r|<1 =
= , if |r|>1=
--------------------------------------------
Note: If |r|<1, sum of infinite series converge to 1/1-r.

