There are finitely many primes $p$ for which the congruence 8x≡1(modp)has no solutions $x$. Determine the sum of all such $p$.
A solution exists if and only if 8 is invertible modulo p. In other words, gcd. Since is a power of 2, 8 is invertible modulo q if and only if q is an odd integer. All primes except for 2 are odd, so the number we are looking for is 2.