What about that equation? What is given and for what are you trying to solve?
Is p supposed to be a prime?
Note tha Mathematica gives, e.g.:
Reduce[a > 1 && Mod[a^((p - 1)/2), p] == Mod[-1, p] /. p -> 3, Integers]
C[1] \[Element] Integers && C[1] >= 0 && a == 2 + 3 C[1]
Reduce[a > 1 && Mod[a^((p - 1)/2), p] == Mod[-1, p] /. p -> 5, Integers]
(C[1] \[Element] Integers && C[1] >= 0 && a == 2 + 5 C[1]) || (C[1] \[Element] Integers && C[1] >= 0 && a == 3 + 5 C[1])