We can build recurrence relations for the numerator and denominator as follows
If you're in math, prove the recurrence relation using Induction!
Now that we can very quickly calculate the numerator and denominator at each iteration, just check if numerator is longer than the denominator
Input an integer (yourinput)
Code will output the number of times the numerator has more digits than the numerator in the first yourinput iterations