Cycle of Powers of Two
Find the remainder of \(2^{17}\) modulo \(5\).
List the first four powers of \(2\) modulo \(5\).
We get \(2,4,3,1\), then the cycle repeats with period \(4\). Since \(17\equiv1\pmod4\), \(2^{17}\equiv2\pmod5\).
Practice
Find the remainder of \(2^{17}\) modulo \(5\).
List the first four powers of \(2\) modulo \(5\).
We get \(2,4,3,1\), then the cycle repeats with period \(4\). Since \(17\equiv1\pmod4\), \(2^{17}\equiv2\pmod5\).
Find the last digit of \(3^{25}\).
The last digits of powers of \(3\) have period \(4\).
The cycle of last digits is \(3,9,7,1\). Since \(25\equiv1\pmod4\), the last digit is \(3\).
Find the remainder of \(4^{12}\) modulo \(7\).
Check what \(4^3\) is modulo \(7\).
\(4^2=16\equiv2\pmod7\), \(4^3\equiv8\equiv1\pmod7\). Hence \(4^{12}=(4^3)^4\equiv1\pmod7\).
Prove that \(7\mid 3^6-1\).
Apply Fermat's little theorem.
The number \(7\) is prime and \(7\nmid3\). By Fermat's little theorem, \(3^6\equiv1\pmod7\). Therefore \(7\mid3^6-1\).
Explain why Euler's theorem cannot be applied to \(2^{10}\) modulo \(8\), and find the remainder.
Check \(\gcd(2,8)\).
\(\gcd(2,8)=2\ne1\), so Euler's theorem cannot be used. But \(2^3=8\equiv0\pmod8\), so every \(2^n\) with \(n\ge3\) is divisible by \(8\). Hence \(2^{10}\equiv0\pmod8\).
Find the remainder of \(5^{2026}\) modulo \(11\).
By Fermat, reduce the exponent modulo \(10\).
Since \(11\) is prime, \(5^{10}\equiv1\pmod{11}\). Also \(2026\equiv6\pmod{10}\), so \(5^{2026}\equiv5^6\). Now \(5^2\equiv3\), \(5^4\equiv9\), hence \(5^6\equiv9\cdot3=27\equiv5\pmod{11}\).
Find the remainder of \(2^{100}\) modulo \(13\).
Use \(2^{12}\equiv1\pmod{13}\).
By Fermat, \(2^{12}\equiv1\pmod{13}\). Since \(100\equiv4\pmod{12}\), \(2^{100}\equiv2^4=16\equiv3\pmod{13}\).
Find the remainder of \(7^{50}\) modulo \(9\).
Check \(7^3\) modulo \(9\).
\(7^2=49\equiv4\pmod9\), \(7^3\equiv4\cdot7=28\equiv1\pmod9\). Since \(50\equiv2\pmod3\), \(7^{50}\equiv7^2\equiv4\pmod9\).
Find the last two digits of \(3^{40}\).
Work modulo \(100\) and apply Euler's theorem.
\(\gcd(3,100)=1\), and \(\varphi(100)=40\). By Euler's theorem, \(3^{40}\equiv1\pmod{100}\). Thus the last two digits are \(01\).
Find the remainder of \(11^{2025}\) modulo \(12\).
Notice that \(11\equiv-1\pmod{12}\).
\(11\equiv-1\pmod{12}\). The exponent \(2025\) is odd, so \(11^{2025}\equiv(-1)^{2025}\equiv-1\equiv11\pmod{12}\).
Find the order of \(3\) modulo \(7\).
Compute powers until \(1\) appears for the first time.
\(3^1\equiv3\), \(3^2\equiv2\), \(3^3\equiv6\), \(3^4\equiv4\), \(3^5\equiv5\), \(3^6\equiv1\pmod7\). Since \(1\) did not appear earlier, the order is \(6\).
Find all positive \(n\) such that \(3^n\equiv1\pmod7\).
Use the order of \(3\) modulo \(7\).
From the previous problem, \(\operatorname{ord}_7(3)=6\). Therefore \(3^n\equiv1\pmod7\) if and only if \(6\mid n\). The answer is all positive multiples of \(6\).
Find the remainder of \(2^{2026}+3^{2026}\) modulo \(5\).
Both powers have period \(4\) modulo \(5\).
Since \(2026\equiv2\pmod4\), \(2^{2026}\equiv2^2\equiv4\pmod5\) and \(3^{2026}\equiv3^2\equiv9\equiv4\pmod5\). The sum is \(4+4=8\equiv3\pmod5\).
Prove that \(13\mid 5^{12k}-1\) for every positive integer \(k\).
First apply Fermat to \(5^{12}\).
Since \(13\) is prime and \(13\nmid5\), \(5^{12}\equiv1\pmod{13}\). Then \(5^{12k}=(5^{12})^k\equiv1^k\equiv1\pmod{13}\). Hence \(13\mid5^{12k}-1\).
Find the last two digits of \(9^{2026}\).
Compute the cycle of powers of \(9\) modulo \(100\).
\(9^1\equiv9\), \(9^2\equiv81\), \(9^3\equiv29\), \(9^4\equiv61\), \(9^5\equiv49\), \(9^6\equiv41\), \(9^7\equiv69\), \(9^8\equiv21\), \(9^9\equiv89\), \(9^{10}\equiv1\pmod{100}\). Since \(2026\equiv6\pmod{10}\), \(9^{2026}\equiv9^6\equiv41\pmod{100}\). The last two digits are \(41\).
Find the remainder of \(3^{2026}\) modulo \(28\).
Split the modulus \(28\) into \(4\) and \(7\).
Modulo \(4\), \(3^{2026}\equiv1\), since the exponent is even. Modulo \(7\), \(3^6\equiv1\), and \(2026\equiv4\pmod6\), so \(3^{2026}\equiv3^4=81\equiv4\pmod7\). We need a number congruent to \(1\) modulo \(4\) and to \(4\) modulo \(7\). It is \(25\). The answer is \(25\).
Prove that for every prime \(p\) and every integer \(a\), the number \(a^p-a\) is divisible by \(p\).
Split into the cases \(p\mid a\) and \(p\nmid a\).
If \(p\mid a\), then \(a^p-a\equiv0-0\equiv0\pmod p\). If \(p\nmid a\), Fermat gives \(a^{p-1}\equiv1\pmod p\). Multiplying by \(a\), \(a^p\equiv a\pmod p\). In both cases, \(p\mid a^p-a\).
Let \(p\) be prime and \(p\nmid a\). Prove that \(a^{p-2}\) is the inverse of \(a\) modulo \(p\).
Multiply \(a^{p-2}\) by \(a\).
By Fermat, \(a^{p-1}\equiv1\pmod p\). But \(a\cdot a^{p-2}=a^{p-1}\). Therefore \(a\cdot a^{p-2}\equiv1\pmod p\), so \(a^{p-2}\) is the inverse.
Find the inverse of \(7\) modulo \(13\).
You may compute directly or use \(7^{11}\).
Direct computation: \(7\cdot2=14\equiv1\pmod{13}\). Hence the inverse of \(7\) is \(2\). This agrees with Fermat: \(7^{11}\) must also be an inverse of \(7\).
Find the remainder of \(2^{1000}\) modulo \(31\).
Notice that \(2^5\equiv1\pmod{31}\).
\(2^5=32\equiv1\pmod{31}\). Since \(1000\) is divisible by \(5\), \(2^{1000}=(2^5)^{200}\equiv1\pmod{31}\).
Find all primes \(p\) such that \(p\mid 2^p+1\).
For odd \(p\), use \(2^p\equiv2\pmod p\).
For \(p=2\), \(2^2+1=5\), not divisible by \(2\). Let \(p\) be an odd prime. By Fermat in the form \(a^p\equiv a\pmod p\), \(2^p\equiv2\pmod p\). Then \(2^p+1\equiv3\pmod p\). For \(p\mid2^p+1\), we need \(p\mid3\), so \(p=3\). Check: \(2^3+1=9\), divisible by \(3\). The answer is \(p=3\).
Let \(p\) be an odd prime, \(p\mid a^2+1\), and \(p\nmid a\). Prove that \(p\equiv1\pmod4\).
From \(a^2\equiv-1\pmod p\), find the order of \(a\) modulo \(p\).
We have \(a^2\equiv-1\pmod p\). Then \(a^4\equiv1\pmod p\), but \(a^2\not\equiv1\pmod p\), since that would give \(-1\equiv1\pmod p\), hence \(p=2\). Thus the order of \(a\) modulo \(p\) is \(4\). The order divides \(p-1\), so \(4\mid p-1\), i.e. \(p\equiv1\pmod4\).
Find all primes \(p\) such that \(p\mid 3^p+2\).
Modulo \(p\), \(3^p\) is congruent to \(3\).
By Fermat, \(3^p\equiv3\pmod p\) for every prime \(p\). Hence \(3^p+2\equiv5\pmod p\). If \(p\mid3^p+2\), then \(p\mid5\), so \(p=5\). Check: \(3^5+2=243+2=245\), divisible by \(5\). The answer is \(p=5\).
Let \(n\ge1\), and let \(p\) be an odd prime divisor of \(2^{2^n}+1\). Prove that \(p\equiv1\pmod{2^{n+1}}\).
Consider the order of \(2\) modulo \(p\).
From the condition, \(2^{2^n}\equiv-1\pmod p\). Squaring gives \(2^{2^{n+1}}\equiv1\pmod p\). Thus the order of \(2\) modulo \(p\) divides \(2^{n+1}\). But it does not divide \(2^n\), because \(2^{2^n}\equiv-1\not\equiv1\pmod p\). Since all divisors of \(2^{n+1}\) are powers of two, the order is \(2^{n+1}\). The order of an element modulo prime \(p\) divides \(p-1\), hence \(2^{n+1}\mid p-1\). Therefore \(p\equiv1\pmod{2^{n+1}}\).