Step 1: Powers of 2 modulo 7 repeat every 3 steps: \(2^1\equiv2,\ 2^2\equiv4,\ 2^3\equiv1\).
Step 2: \(31 = 3\times10 + 1\), so \(2^{31}\equiv (2^3)^{10}\cdot 2^1 \equiv 1\cdot 2 \equiv 2 \pmod 7\).
Quick Tip: Find the cycle length of the remainders, then reduce the exponent modulo that length.