Explanation
The sequence {1, r, r^2, r^3, r^4, ...} is geometric with these properties
Since r is between 0 and 1 excluding both endpoints, it allows us to use this formula
S = a/(1-r)
That formula has us adding up the infinitely many terms of the geometric sequence. Again we don't know what r is, so we leave it alone. But we do know that a = 1.
So that's how we get to S = 1/(1 - r)
For instance, if r = 1/2 then S = 2. Or if r = 1/3, then S = 3/2