# largest integer which gives same modulus result

Turns out, if we have n numbers, $a_1, a_2, ..., a_n$, M should be equal to the GCF of all of the pairwise differences $a_i - a_j$. This is because if M is the largest modulus such that all the $a_i$ are congruent, then $a_i - a_j \equiv 0 (\mod M)$ for all i,j. Therefore M must be a factor of all the pairwise differences, and the largest such M is the GCF of these differences.