Let n be the integer such that 0≤n<31 and 3n≡1(mod31) . What is (2n)3−2(mod31)? Express your answer as an integer from 0 to 30, inclusive.
I used a calculator, and got an answer of 17.