Problem 235: An Arithmetic Geometric sequence

FCC link

Given is the arithmetic-geometric sequence u(k) = (900-3k)rk-1.

Let s(n) = Σk=1...nu(k).

Find the value of r for which s(5000) = -600,000,000,000.

Give your answer rounded to 12 places behind the decimal point.

Test

{{test}}

Console output