In the equation you showed, I is the intensity of the earthquake and S is the intensity of a standard earthquake. The magnitude of this last one is “log S/S=0”. So, in the Richter Scale 0 is the same of the log of an earthquake with magnitude of 10. If we elevate 10 4 times, we reach to 10000, the times in the problem above. So, Richter Scale of '4' = lof(10⁴) = log(10000) = earthquake with a magnitude of 10000.
With this explained, you can notice how 4 is the correct answer.