If a has a common factor m with 24, then m would divide evenly into
the left hand side, and hence m would divide evenly into 1.
Hence the only common factor of a and 24 is 1, and the same
argument applies to b as well.
As a result, when a or b are divided by 24, the only possible remainders
are 1, 5, 7, 11, 13, 17, 19 and 23.
And since ab + 1 is a multiple of 24, it's easy to check that the only
possible combinations of remainders for a and b are
(1 and 23), (5 and 19), (7 and 17), and (11 and 13).
For each of these cases, it is clear that a + b will be a multiple