Here's the problem:
$a\equiv 24\;(mod\;31)$
such that $-15\leq a \leq 15$
I simplified the equation to:
$a \;mod \;31 = 24$
and found through guess and check that the answer is: $-7$
My question is, how do I find a through 'math', without using the guess and check method?
Thanks in advance for the help!
--EDIT FOR MOST RECENT ANSWER--
So you are re-writing the congruence as:
$a = 24\; +31k \;\;such \;that \;-15\leq a \leq 15$
It can be 'easily' seen that -1 is the only value for k that satisfies $a$ within the given boundary, resulting in $a = -7$.
Another argument:
You did not simplify by rewriting the original congruence. The treatment of congruence that you were working from should have told you that the numbers that are congruent to $24$ modulo $31$ are exactly the numbers of form $24+31k$, where $k$ runs through all integers, positive, negative, and zero. With that, you could see at a glance that $k=-1$ gives you the desired number.