Project Euler 235 - An Arithmetic Geometric sequence

Official link:

Thought Process

A very easy problem, sort of an easier version of Problem 751.

I just manually add a digit to r and because the larger r gets the smaller s(5000) gets.

If my selected r goes below -600,000,000,000 I append the previous digit and then repeat

For example 1.1 makes it to small therefore let r = 1.0, then 1.01 is too small so we make r = 1.00, then 1.003 is too small, therefore r = 1.002, etc, etc

Interactive Code

No interactive code for this problem, my code is given below