A Power Modulo \(11\)
Find \(2^{2026}\pmod{11}\).
Reduce the exponent modulo \(10\).
By Fermat, \(2^{10}\equiv1\pmod{11}\). Since \(2026\equiv6\pmod{10}\), we get \(2^{2026}\equiv2^6=64\equiv9\pmod{11}\).
Practice
Find \(2^{2026}\pmod{11}\).
Reduce the exponent modulo \(10\).
By Fermat, \(2^{10}\equiv1\pmod{11}\). Since \(2026\equiv6\pmod{10}\), we get \(2^{2026}\equiv2^6=64\equiv9\pmod{11}\).
Find \(2^{100}\pmod9\).
Use \(\varphi(9)=6\).
Since \(\gcd(2,9)=1\), Euler gives \(2^6\equiv1\pmod9\). Since \(100\equiv4\pmod6\), \(2^{100}\equiv2^4=16\equiv7\pmod9\).
Find the inverse of \(7\) modulo \(13\).
Compute directly or use \(7^{11}\).
Directly, \(7\cdot2=14\equiv1\pmod{13}\). Thus the inverse is \(2\). This agrees with Fermat: \(7^{12}\equiv1\), so \(7^{11}\) is also an inverse.
Find \(10!\pmod{11}\).
Apply Wilson.
Since \(11\) is prime, \(10!\equiv-1\equiv10\pmod{11}\).
Find \(\varphi(45)\).
Factor \(45=3^2\cdot5\).
Use the formula: \(\varphi(45)=45(1-1/3)(1-1/5)=45\cdot2/3\cdot4/5=24\).
Prove that for every prime \(p\) and every integer \(a\), \(p\mid a^p-a\).
Consider the cases \(p\mid a\) and \(p\nmid a\).
If \(p\mid a\), then \(a^p-a\) is divisible by \(p\). If \(p\nmid a\), Fermat gives \(a^{p-1}\equiv1\pmod p\), and multiplying by \(a\) gives \(a^p\equiv a\pmod p\).
Find \(7^{100}\pmod{13}\).
Reduce the exponent modulo \(12\).
By Fermat, \(7^{12}\equiv1\pmod{13}\). Since \(100\equiv4\pmod{12}\), \(7^{100}\equiv7^4\). Now \(7^2=49\equiv10\), so \(7^4\equiv100\equiv9\pmod{13}\).
Find the last two digits of \(3^{80}\).
Work modulo \(100\).
\(\gcd(3,100)=1\), \(\varphi(100)=40\). Euler gives \(3^{40}\equiv1\pmod{100}\), hence \(3^{80}\equiv1\pmod{100}\). The last two digits are \(01\).
Find \(8!\pmod{11}\).
Express \(10!\) through \(8!\).
By Wilson, \(10!\equiv-1\pmod{11}\). But \(10!=10\cdot9\cdot8!\equiv(-1)(-2)8!\equiv2\cdot8!\). Hence \(2\cdot8!\equiv10\), so \(8!\equiv5\pmod{11}\).
Let \(p\) be an odd prime. Prove that \((p-2)!\equiv1\pmod p\).
Write \((p-1)!=(p-1)(p-2)!\).
By Wilson, \((p-1)!\equiv-1\pmod p\). But \((p-1)!\equiv(p-1)(p-2)!\equiv-(p-2)!\pmod p\). Hence \(-(p-2)!\equiv-1\), so \((p-2)!\equiv1\pmod p\).
Let \(p>3\) be prime. Find \((p-3)!\pmod p\).
Express \((p-1)!\) through \((p-3)!\).
We have \((p-1)!=(p-1)(p-2)(p-3)!\equiv(-1)(-2)(p-3)!\equiv2(p-3)!\pmod p\). By Wilson this equals \(-1\). Hence \(2(p-3)!\equiv-1\), so \((p-3)!\equiv -2^{-1}\pmod p\). Since \(2^{-1}\equiv (p+1)/2\), we get \((p-3)!\equiv (p-1)/2\pmod p\).
Find the remainder of \(7^{222}\) modulo \(100\).
Use \(\varphi(100)=40\), but a short cycle is even better.
Notice that \(7^4\equiv1\pmod{100}\). Since \(222\equiv2\pmod4\), we get \(7^{222}\equiv7^2=49\pmod{100}\).
Let \(p\) be prime. Prove that \(p\mid a^{p+1}-a^2\) for every integer \(a\).
Factor \(a\), or use \(a^p\equiv a\).
By Fermat's form, \(a^p\equiv a\pmod p\). Multiplying by \(a\), we get \(a^{p+1}\equiv a^2\pmod p\). Hence \(p\mid a^{p+1}-a^2\).
Show that \(8!\not\equiv-1\pmod9\), and explain why this does not contradict Wilson.
The product \(8!\) contains factors \(3\) and \(6\).
Since \(8!\) contains factors \(3\) and \(6\), the product is divisible by \(9\). Thus \(8!\equiv0\pmod9\), not \(-1\). There is no contradiction: Wilson's theorem states \((p-1)!\equiv-1\pmod p\) for prime \(p\), while \(9\) is composite.
Let \(\gcd(a,n)=1\). Prove that \(a^{\varphi(n)-1}\) is the inverse of \(a\) modulo \(n\).
Multiply by \(a\) and apply Euler.
Euler's theorem gives \(a^{\varphi(n)}\equiv1\pmod n\). But \(a\cdot a^{\varphi(n)-1}=a^{\varphi(n)}\). Hence \(a^{\varphi(n)-1}\) is indeed the inverse.
Find all primes \(p\) such that \(p\mid2^{p-1}+1\).
Handle \(p=2\), then apply Fermat.
For \(p=2\), \(2^{p-1}+1=3\) is not divisible by \(2\). If \(p\) is odd, Fermat gives \(2^{p-1}\equiv1\pmod p\). Then \(2^{p-1}+1\equiv2\pmod p\), not \(0\). Answer: there are no such primes.
Prove Wilson's theorem: if \(p\) is prime, then \((p-1)!\equiv-1\pmod p\).
Pair nonzero residues with their inverses.
In the set \(1,2,\ldots,p-1\), every residue has an inverse. Residues equal to their own inverses satisfy \(x^2\equiv1\pmod p\), hence \(x\equiv1\) or \(x\equiv-1\pmod p\). All other residues pair as \(x,x^{-1}\), and each pair has product \(1\). Therefore \((p-1)!\equiv1\cdot(-1)\equiv-1\pmod p\).
Let \(p>3\) be prime. Find the product of all \(x\in\{1,\ldots,p-1\}\) such that \(x\not\equiv x^{-1}\pmod p\), modulo \(p\).
Remove the self-inverse elements \(1\) and \(-1\).
The self-inverse elements satisfy \(x^2\equiv1\pmod p\), so they are \(1\) and \(-1\). The product of all nonzero residues is \((p-1)!\equiv-1\pmod p\). Removing the factors \(1\) and \(-1\), the remaining product is \((-1)/(1\cdot(-1))\equiv1\pmod p\).
Find the remainder of \(11^{2026}\) modulo \(72\).
Use \(\varphi(72)=24\), or split \(72=8\cdot9\).
\(\gcd(11,72)=1\), \(\varphi(72)=72(1-1/2)(1-1/3)=24\). Thus \(11^{24}\equiv1\pmod{72}\). Since \(2026\equiv10\pmod{24}\), we need \(11^{10}\pmod{72}\). Now \(11^2=121\equiv49\), \(11^4\equiv49^2=2401\equiv25\), \(11^8\equiv25^2=625\equiv49\). Hence \(11^{10}=11^8\cdot11^2\equiv49\cdot49=2401\equiv25\pmod{72}\).
Prove that if \(n>1\) and \((n-1)!\equiv-1\pmod n\), then \(n\) is prime.
Assume \(n\) is composite and take a proper divisor \(d\) of \(n\).