You may find useful to know that where both factors are prime...
Dear Friend,
Laurent gives the accurate answer. As an extra explanation we can say :
n(n+b)=999919
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