(…) I thought of calculating m for the values of the divisors of 24, that is, making m belonging to D (24). (…)
Definition of residue. The number in the congruence is called the residue of . In the case at hand and .
This means that for some integer the following equality holds . You should then have , where and are positive integers. This implies that , because is a prime number, that is, it has no divisors, except and .