I am not sure what you mean by guess and check but the way I would do is to pick an arbitrary value for b and then solve for a. It may be ugly but it works. There are two variables there so you do not have a unique solution.
actually, the two numbers have to be intergers (ie whole positive numbers) so there is only one solution. The answers are a=7, b=3- so is there a proper method to solving these problems.