MathLabs

Problem 4

Determine all positive integers relatively prime to all the terms of the infinite sequence an=2n+3n+6n−1, n≥1.a_n=2^n+3^n+6^n -1,\ n\geq 1.
Step 3 of 5: Turn the exponent p−2p-2 into an inverse mod pp
ap−2=2p−2+3p−2+6p−2−1≡2−1+3−1+6−1−1(modp)a_{p-2}=2^{p-2}+3^{p-2}+6^{p-2}-1\equiv2^{-1}+3^{-1}+6^{-1}-1\pmod p
Detailed analysis

Since 2p−1≡1(modp)2^{p-1}\equiv1\pmod p, multiplying both sides by 2−12^{-1} gives 2p−2≡2−1(modp)2^{p-2}\equiv2^{-1}\pmod p, and likewise 3p−2≡3−13^{p-2}\equiv3^{-1}, 6p−2≡6−1(modp)6^{p-2}\equiv6^{-1}\pmod p. Substituting n=p−2n=p-2 into ana_n gives the stated congruence.