You may find useful to know that where both factors are prime...
Laurent gives the accurate answer. As an extra explanation we can say :
where n is number of cats, and b is the difference between number of mice caught by cats and number of cats.
As Laurent said :
(991)(991 + b ) = 999919
b = 18
(991)(991 + 18 ) 999919