Discrete MathematicsModular Arithmetic and Cryptography2 of 6
Modular Arithmetic and Cryptography · 2

Divisibility Rules and Last Digits

Testing whether a seven-digit number divides cleanly by 44, 99, 1111, or 1212, or finding the final digits of a huge power like 72,0267^{2{,}026}, comes down to breaking numbers apart in base 1010 and throwing away every piece that leaves a remainder of 0\clean{0}.

1

Divisibility by 2, 5, 10, 4, and 8

We want to tell right away whether a number like 374374 is divisible by 55, or whether 5,831,9245{,}831{,}924 is divisible by 44 or 88, without doing long division across the whole number. Remember that a number divides cleanly by nn when its remainder is 0\clean{0}, which is when it is congruent to 0(modn)\clean{0} \pmod n.

5,831,9\whole{5{,}831{,}9}
2424
5,831,900=58,319×100≡0(mod4)\begin{aligned} \whole{5{,}831{,}900} &= \whole{58{,}319 \times 100} \\ &\equiv \clean{0} \pmod 4 \end{aligned}
5,831,\whole{5{,}831{,}}
924924
5,831,000=5,831×1,000≡0(mod8)\begin{aligned} \whole{5{,}831{,}000} &= \whole{5{,}831 \times 1{,}000} \\ &\equiv \clean{0} \pmod 8 \end{aligned}
Divisibility by 2, 5, 10, 4, and 8
5,831,9245{,}831{,}924
÷4 ?\div 4\,\htmlClass{lc-mute}{?}
÷9 ?\div 9\,\htmlClass{lc-mute}{?}
÷11 ?\div 11\,\htmlClass{lc-mute}{?}
÷12 ?\div 12\,\htmlClass{lc-mute}{?}
72026=…7^{2026} = \ldots
7×7×7×⋯×7⏟2026\underbrace{7 \times 7 \times 7 \times \cdots \times 7}_{\htmlClass{lc-mute}{2026}}
Text solution
Split off the tens place to test 22, 55, or 1010Write 374374 as thirty-seven groups of 1010 plus the ones digit 4\leftover{4}.
374\displaystyle 374 =370+4\displaystyle = \whole{370} + \leftover{4} =(37×10)+4\displaystyle = (\whole{37 \times 10}) + \leftover{4}
Drop the tens because 10=2×510 = \whole{2 \times 5}Since 10≡0(mod5)10 \equiv \clean{0} \pmod 5 (and also mod 22 and mod 1010), every group of 1010 leaves 0\clean{0} remainder and disappears.
374≡(37×0)+4\displaystyle 374 \equiv (\whole{37 \times 0}) + \leftover{4} =4(mod5)\displaystyle = \leftover{4} \pmod 5
Because 4≢0(mod5)\leftover{4} \not\equiv 0 \pmod 5, 374374 is not divisible by 55 and leaves a remainder of 4\leftover{4}.
Split off the hundreds place to test 44A single 1010 leaves a remainder mod 44 (10=4×2+2≡2(mod4)10 = \whole{4 \times 2} + \leftover{2} \equiv \leftover{2} \pmod 4), so move one place left to 100=4×25≡0(mod4)100 = \whole{4 \times 25} \equiv \clean{0} \pmod 4 and split 5,831,9245{,}831{,}924 at the hundreds.
5,831,924\displaystyle 5{,}831{,}924 =5,831,900+24\displaystyle = \whole{5{,}831{,}900} + 24 =(58,319×100)+24\displaystyle = (\whole{58{,}319 \times 100}) + 24
Drop the hundreds and check the last two digitsEvery hundred is congruent to 0(mod4)\clean{0} \pmod 4, leaving only 2424.
5,831,924≡(58,319×0)+24=24=4×6≡0(mod4)\displaystyle \begin{aligned} 5{,}831{,}924 &\equiv (\whole{58{,}319 \times 0}) + 24 \\ &= 24 = \whole{4 \times 6} \\ &\equiv \clean{0} \pmod 4 \end{aligned}
Since the last two digits divide cleanly by 44, the entire number 5,831,9245{,}831{,}924 is divisible by 44.
Split off the thousands place to test 88Because 100=8×12+4≡4(mod8)100 = \whole{8 \times 12} + \leftover{4} \equiv \leftover{4} \pmod 8 still leaves a remainder, move one place further left to 1,000=8×125≡0(mod8)1{,}000 = \whole{8 \times 125} \equiv \clean{0} \pmod 8, which wipes out everything from the thousands place up and leaves only the last three digits to check.
2

Divisibility by 9, 3, and 11

When we test whether a number is divisible by 99, 33, or 1111, we can no longer cross out the front of the number, because none of 1010, 100100, or 1,0001{,}000 divides cleanly by 99, 33, or 1111. Instead, we want to find how much each power of 1010 leaves behind, and use those small remainders to shrink the entire number at once.

Divisibility by 9, 3, and 11
10≡  ?(mod9)100≡  ?(mod9)1000≡  ?(mod9)\displaystyle \begin{aligned} 10 &\equiv \;\htmlClass{lc-mute}{?} \pmod 9 \\ 100 &\equiv \;\htmlClass{lc-mute}{?} \pmod 9 \\ 1000 &\equiv \;\htmlClass{lc-mute}{?} \pmod 9 \end{aligned}
Text solution
Turn each power of 1010 into +1\leftover{+1} for mod 99 and mod 33Every power of 1010 is just 1\leftover{1} more than a string of 99s (10=9+110 = \whole{9} + \leftover{1}, 100=99+1100 = \whole{99} + \leftover{1}, 1,000=999+11{,}000 = \whole{999} + \leftover{1}), and since 9=3×39 = 3 \times 3, those strings of 99s divide cleanly by both 99 and 33.
10i≡1i\displaystyle 10^i \equiv \leftover{1^i} =1(mod9)and10i≡1(mod3)\displaystyle = \leftover{1} \pmod 9 \quad \text{and} \quad 10^i \equiv \leftover{1} \pmod 3
Add the digits to test 425(mod9)425 \pmod 9Each of the 44 hundreds, 22 tens, and 55 ones leaves a remainder of 1\leftover{1} per unit, so the remainder of 425425 is the sum of its digits.
425=4(100)+2(10)+5≡4(1)+2(1)+5=11≡1+1=2(mod9)\displaystyle \begin{aligned} 425 &= 4(100) + 2(10) + 5 \\ &\equiv 4(\leftover{1}) + 2(\leftover{1}) + 5 = 11 \\ &\equiv 1 + 1 = \leftover{2} \pmod 9 \end{aligned}
So 425425 leaves a remainder of 2\leftover{2} when divided by 99, and is not divisible by 99.
Turn each power of 1010 into (−1)i\leftover{(-1)^i} for mod 1111Because 1010 is 11 short of 1111, we have 10≡−1(mod11)10 \equiv \leftover{-1} \pmod{11}, so each step to the left multiplies the place-value remainder by −1\leftover{-1} and flips its sign.
1≡+1,10≡−1,100=102≡(−1)2=+1,1,000=103≡(−1)3=−1(mod11)\displaystyle \begin{aligned} 1 &\equiv \leftover{+1}, \\ 10 &\equiv \leftover{-1}, \\ 100 = 10^2 &\equiv \leftover{(-1)^2} = \leftover{+1}, \\ 1{,}000 = 10^3 &\equiv \leftover{(-1)^3} \\ &= \leftover{-1} \pmod{11} \end{aligned}
Alternate signs from right to left to test 7,293(mod11)7{,}293 \pmod{11}Start with +\leftover{+} on the ones digit 33 and alternate −,+,−\leftover{-}, \leftover{+}, \leftover{-} moving left across the digits.
7,293=7(1,000)+2(100)+9(10)+3≡7(−1)+2(+1)+9(−1)+3(+1)=−7+2−9+3=−11≡0(mod11)\displaystyle \begin{aligned} 7{,}293 &= 7(1{,}000) + 2(100) \\ &\quad + 9(10) + 3 \\ &\equiv 7(\leftover{-1}) + 2(\leftover{+1}) \\ &\quad + 9(\leftover{-1}) + 3(\leftover{+1}) \\ &= -7 + 2 - 9 + 3 \\ &= \whole{-11} \equiv \clean{0} \pmod{11} \end{aligned}
Because the alternating sum is a multiple of 1111, 7,2937{,}293 divides cleanly by 1111.
Prove the rules for any base-1010 integer nnWrite any integer nn with digits dkdk−1…d2d1d0d_k d_{k-1} \dots d_2 d_1 d_0 in its base-1010 expansion and substitute the remainder of 10i10^i into each term.
n\displaystyle n =dk10k+⋯+d2102+d110+d0\displaystyle = d_k 10^k + \dots + d_2 10^2 + d_1 10 + d_0
Replacing every 10i10^i with 1(mod9)\leftover{1} \pmod 9 (or mod 33) gives the digit sum:
n≡dk(1)+⋯+d2(1)+d1(1)+d0=dk+⋯+d2+d1+d0(mod9)\displaystyle \begin{aligned} n &\equiv d_k(\leftover{1}) + \dots + d_2(\leftover{1}) \\ &\quad + d_1(\leftover{1}) + d_0 \\ &= d_k + \dots + d_2 \\ &\quad + d_1 + d_0 \pmod 9 \end{aligned}
Replacing every 10i10^i with (−1)i(mod11)\leftover{(-1)^i} \pmod{11} gives the alternating digit sum:
n≡dk(−1)k+⋯+d2(−1)2+d1(−1)1+d0=d0−d1+d2−d3+…+(−1)kdk(mod11)\displaystyle \begin{aligned} n &\equiv d_k\leftover{(-1)^k} + \dots + d_2\leftover{(-1)^2} \\ &\quad + d_1\leftover{(-1)^1} + d_0 \\ &= d_0 - d_1 + d_2 - d_3 + \dots \\ &\quad + \leftover{(-1)^k} d_k \pmod{11} \end{aligned}
Because nn and its digit sum (or alternating sum) leave the exact same remainder, n≡0n \equiv \clean{0} if and only if that sum is divisible by 99 (or 33, or 1111).

Each power of 1010 is 1\leftover{1} more than a multiple of 99 (9\whole{9}, 99\whole{99}, 999\whole{999}), so every place-value column leaves +1\leftover{+1} mod 99. Beside multiples of 1111 (11\whole{11}, 99\whole{99}, 1,001\whole{1{,}001}), the powers of 1010 alternate between 1\leftover{1} short and 1\leftover{1} over, so the columns flip between +1\leftover{+1} and −1\leftover{-1}.

Moving a unit to the next column keeps its remainder mod 9 the same, but flips the sign of its remainder mod 11.

When you use the mod 1111 rule, always label the signs starting with +\leftover{+} on the ones digit at the far right and work leftward. Starting on the left will flip every sign whenever the number has an even number of digits.

3

Divisibility by Composite Numbers

Now suppose we want to test whether a number is divisible by a composite number like 66, 1212, 3636, 4545, or 7272. Rather than building a brand-new rule, we can split the composite divisor into two smaller factors whose rules we already know, provided those two tests don't check the same prime factor twice.

12=2×612 = \two{2} \times 6
12=12 =
22
22
33
18=18 =
2\two{2}
22
33
33
66
18÷1218 \div 12
12=4×312 = \two{4} \times \three{3}
4\two{4}
12=12 =
22
22
33
3\three{3}
Divisibility by Composite Numbers
22
33
44
55
88
99
1010
1111
6=2×312=2×6  ?\begin{aligned} 6 &= \two{2} \times \three{3} \\ 12 &= \two{2} \times 6\;\htmlClass{lc-mute}{?} \end{aligned}
Text solution
Check why splitting 1212 into 2×6\two{2} \times 6 fails on 1818A multiple of 12=2×2×312 = \two{2} \times \two{2} \times \three{3} must contain two factors of 2\two{2} and one factor of 3\three{3}, but 2\two{2} and 6=2×36 = \two{2} \times \three{3} share a common factor of 2\two{2} and both pass on 1818 even though 1818 has only a single 2\two{2}.
18=2×9(passes 2),18=6×3(passes 6),18=12×1+6≢0(mod12)\displaystyle \begin{aligned} 18 &= 2 \times 9 &&(\text{passes } 2), \\ 18 &= 6 \times 3 &&(\text{passes } 6), \\ 18 &= \whole{12 \times 1} + \leftover{6} \\ &\not\equiv 0 \pmod{12} \end{aligned}
Split the composite divisor into factors with no common factor greater than 11Grouping all identical primes together prevents any overlap between the two tests.
12=3×4,36=4×9,45=5×9,72=8×9\displaystyle \begin{aligned} 12 &= \three{3} \times \two{4}, & 36 &= \two{4} \times \three{9}, \\ 45 &= \five{5} \times \three{9}, & 72 &= \two{8} \times \three{9} \end{aligned}
Test 5,831,9245{,}831{,}924 for divisibility by 1212, 99, and 1111To check 12=4×312 = \two{4} \times \three{3}, combine the last-two-digits test for 44 with the digit-sum test for 33.
Mod 4:5,831,924≡24\displaystyle \text{Mod } 4: \quad 5{,}831{,}924 \equiv 24 =4×6≡0(mod4)(passes 4)\displaystyle = \whole{4 \times 6} \equiv \clean{0} \pmod 4 \quad (\text{passes } 4)
Mod 3 and Mod 9:5+8+3+1+9+2+4\displaystyle \text{Mod } 3 \text{ and Mod } 9: \quad 5 + 8 + 3 + 1 + 9 + 2 + 4 =32≡3+2\displaystyle = 32 \equiv 3 + 2 =5≢0(fails 3 and 9)\displaystyle = \leftover{5} \not\equiv 0 \quad (\text{fails } 3 \text{ and } 9)
Since 5,831,9245{,}831{,}924 fails the test for 33, it is not divisible by 1212, and its remainder mod 99 is 5\leftover{5}. Checking the alternating sum from the right for 1111 completes all four opening questions:
Mod 11:4−2+9−1+3−8+5\displaystyle \text{Mod } 11: \quad 4 - 2 + 9 - 1 + 3 - 8 + 5 =10≢0(mod11)\displaystyle = \leftover{10} \not\equiv 0 \pmod{11}
So 5,831,9245{,}831{,}924 leaves a remainder of 10\leftover{10} when divided by 1111 and is not divisible by 1111 either.
4

Last Digits of Large Powers

Now we turn to our second big question: finding the last digit, or the last two digits, of a giant power like 72,0267^{2{,}026}, or the remainder of 82,0258^{2{,}025} when divided by 99. Because throwing away multiples of 1010 leaves the ones digit and throwing away multiples of 100100 leaves the tens and ones digits, finding the last digit is just finding the remainder mod 1010, and finding the last two digits is just finding the remainder mod 100100.

Remember that we can reduce each factor mod nn before multiplying:

4,827×9,163=(4,820+7)(9,160+3)≡7×3=21≡1(mod10)\displaystyle \begin{aligned} & 4{,}827 \times 9{,}163 \\ &= (\whole{4{,}820} + \leftover{7})(\whole{9{,}160} + \leftover{3}) \\ &\equiv \leftover{7} \times \leftover{3} = 21 \equiv \leftover{1} \pmod{10} \end{aligned}

That means we can multiply by 77 one step at a time and throw away the tens (or hundreds) digit after every single multiplication.

Last Digits of Large Powers
72026=…7^{2026} = \ldots
374=370+4374 = 370 + 4
Text solution
Multiply step by step mod 1010 to find the loop for 72,0267^{2{,}026}Keep only the ones digit after each multiplication by 77 until the remainder hits 1\leftover{1}.
71≡7,72=49≡9,73≡9×7=63≡3,74≡3×7=21≡1(mod10)\displaystyle \begin{aligned} 7^1 & &&\equiv \leftover{7}, \\ 7^2 &= 49 &&\equiv \leftover{9}, \\ 7^3 &\equiv \leftover{9} \times 7 = 63 &&\equiv \leftover{3}, \\ 7^4 &\equiv \leftover{3} \times 7 = 21 &&\equiv \leftover{1} \pmod{10} \end{aligned}
Because 74≡1(mod10)7^4 \equiv \leftover{1} \pmod{10}, the next power 75≡1×7=7(mod10)7^5 \equiv \leftover{1} \times 7 = \leftover{7} \pmod{10} restarts a repeating loop of 44 digits: 7→9→3→1\leftover{7} \to \leftover{9} \to \leftover{3} \to \leftover{1}.
Reduce the exponent mod 44 and evaluateEvery 44 steps in the exponent reset the product to 1\leftover{1}, so use the divisibility rule for 44 to find the remainder of 2,026(mod4)2{,}026 \pmod 4.
2,026≡26\displaystyle 2{,}026 \equiv 26 =4×6+2≡2(mod4)\displaystyle = \whole{4 \times 6} + \leftover{2} \equiv \leftover{2} \pmod 4
Rewrite 2,026=4×506+22{,}026 = \whole{4 \times 506} + \leftover{2} to group out the 506\whole{506} full loops of 44:
72,026=74×506+2=(74)506×72≡1506×9=9(mod10)\displaystyle \begin{aligned} 7^{2{,}026} &= 7^{\whole{4 \times 506} + \leftover{2}} \\ &= \whole{(7^4)^{506}} \times \leftover{7^2} \\ &\equiv \whole{1^{506}} \times \leftover{9} = \leftover{9} \pmod{10} \end{aligned}
So the last digit of 72,0267^{2{,}026} is 99.
Track the loop mod 100100 for the last two digits of 72,0267^{2{,}026}Keep only the last two digits after each multiplication by 77.
71≡07,72≡49,73=343≡43,74≡43×7=301≡01(mod100)\displaystyle \begin{aligned} 7^1 & &&\equiv \leftover{07}, \\ 7^2 & &&\equiv \leftover{49}, \\ 7^3 &= 343 &&\equiv \leftover{43}, \\ 7^4 &\equiv \leftover{43} \times 7 \\ &= 301 &&\equiv \leftover{01} \pmod{100} \end{aligned}
Since 74≡01(mod100)7^4 \equiv \leftover{01} \pmod{100}, the last two digits also cycle every 44 steps (07→49→43→01\leftover{07} \to \leftover{49} \to \leftover{43} \to \leftover{01}), and the same exponent breakdown gives the last two digits:
72,026=(74)506×72≡1506×49=49(mod100)\displaystyle \begin{aligned} 7^{2{,}026} &= \whole{(7^4)^{506}} \times \leftover{7^2} \\ &\equiv \whole{1^{506}} \times \leftover{49} \\ &= \leftover{49} \pmod{100} \end{aligned}
So 72,0267^{2{,}026} ends in the digits 4949.
Use a −1\leftover{-1} remainder directly for 82,025(mod9)8^{2{,}025} \pmod 9Because 88 is 11 short of 99, replace 88 with −1(mod9)\leftover{-1} \pmod 9 right away instead of writing out a cycle.
8≡−1(mod9)  ⟹  82,025≡(−1)2,025\displaystyle 8 \equiv \leftover{-1} \pmod 9 \implies 8^{2{,}025} \equiv \leftover{(-1)^{2{,}025}} =−1≡8(mod9)\displaystyle = \leftover{-1} \equiv \leftover{8} \pmod 9
Since the exponent 2,0252{,}025 is odd, (−1)2,025=−1\leftover{(-1)^{2{,}025}} = \leftover{-1}, which is 11 short of 99 and leaves a remainder of 8\leftover{8}.

When you multiply by a single digit over and over and keep only the ones digit, the remainders always fall into a short repeating loop of 11, 22, or 44 steps. A large exponent just wraps around that loop.

For any base digit from 1 to 9, multiplying over and over settles into a short loop of 1, 2, or 4 last digits.

Watch out for two common traps on power problems: if your exponent divides cleanly by the loop length (remainder 0\clean{0}), the power lands on the final step of the loop (for base 77 mod 1010, that is 74≡17^4 \equiv \leftover{1}), not on 00; and if the base is already 11 above or 11 below a multiple of the modulus (like 8≡−1(mod9)8 \equiv \leftover{-1} \pmod 9), swap in +1\leftover{+1} or −1\leftover{-1} immediately instead of hunting for a loop.

Key concepts

Every problem here comes down to picking how to break the number apart so that nearly all of it turns into 0\clean{0} or 1\leftover{1}:

Ending-digit rules (22, 55, 1010, 44, 88)

Because 10=2×510 = \whole{2 \times 5}, 100=4×25100 = \whole{4 \times 25}, and 1,000=8×1251{,}000 = \whole{8 \times 125}, high enough powers of 1010 become 0\clean{0} in these moduli. Throw away the front of the number and check only the last digit for 22, 55, and 1010 (374≡4(mod5)374 \equiv \leftover{4} \pmod 5), the last two digits for 44 (5,831,924≡24≡0(mod4)5{,}831{,}924 \equiv 24 \equiv \clean{0} \pmod 4), and the last three digits for 88.

All-digit sum rules (99, 33, and 1111)

When no power of 1010 is congruent to 0\clean{0}, shrink 1010 itself before expanding n=dk10k+⋯+d110+d0n = d_k 10^k + \dots + d_1 10 + d_0. For 99 and 33, 10i≡110^i \equiv \leftover{1}, so you sum all the digits (425≡4+2+5=11≡2(mod9)425 \equiv 4 + 2 + 5 = 11 \equiv \leftover{2} \pmod 9). For 1111, 10i≡(−1)i10^i \equiv \leftover{(-1)^i}, so you take the alternating sum starting with +\leftover{+} on the ones digit (7,293≡−7+2−9+37{,}293 \equiv -7 + 2 - 9 + 3 =−11≡0(mod11)= \whole{-11} \equiv \clean{0} \pmod{11}).

Composite divisors

Split the divisor into two factors that share no common factors greater than 11, such as 12=3×412 = \three{3} \times \two{4} or 72=8×972 = \two{8} \times \three{9}. Do not use overlapping factors like 12=2×612 = \two{2} \times 6, which double-count the same factor of 2\two{2} and fail on numbers like 1818.

Last digits and remainders of large powers

Use (mod10)\pmod{10} for the last digit and (mod100)\pmod{100} for the last two digits. Reduce the base first; if the base is right next to a multiple of the modulus, substitute ±1\leftover{\pm 1} immediately without building a cycle (82,025≡(−1)2,0258^{2{,}025} \equiv \leftover{(-1)^{2{,}025}} =−1≡8(mod9)= \leftover{-1} \equiv \leftover{8} \pmod 9). Otherwise, multiply step by step until you hit 1\leftover{1} (or come back to a remainder you've already seen) to find the loop length, and reduce the exponent modulo that loop length (72,0267^{2{,}026} == (74)506×72≡1506×9\whole{(7^4)^{506}} \times \leftover{7^2} \equiv \whole{1^{506}} \times \leftover{9} == 9(mod10)\leftover{9} \pmod{10}).

5

Practice

1

Without performing long division, find the remainder when 6,418,7566{,}418{,}756 is divided by 88, by 99, and by 1111.

Which power of 1010 disappears mod 88, and what happens to 10i10^i in mod 99 versus mod 1111? In mod 1111, make sure you start your alternating signs at the ones place.

Mod 88Because 1,000=8×125≡0(mod8)1{,}000 = \whole{8 \times 125} \equiv \clean{0} \pmod 8, throw away the thousands place and above and divide only the last three digits (do not stop at the last two digits 56=8×756 = 8 \times 7, which is the test for 44 and would wrongly give a remainder of 00):
6,418,756≡756\displaystyle 6{,}418{,}756 \equiv 756 =8×94+4≡4(mod8)\displaystyle = \whole{8 \times 94} + \leftover{4} \equiv \leftover{4} \pmod 8
Mod 99Since 10i≡1(mod9)10^i \equiv \leftover{1} \pmod 9, sum all the digits:
6,418,756≡6+4+1+8+7+5+6=37≡3+7=10≡1(mod9)\displaystyle \begin{aligned} & 6{,}418{,}756 \\ &\equiv 6 + 4 + 1 + 8 + 7 + 5 + 6 = 37 \\ &\equiv 3 + 7 = 10 \equiv \leftover{1} \pmod 9 \end{aligned}
Mod 1111Since 10i≡(−1)i(mod11)10^i \equiv \leftover{(-1)^i} \pmod{11}, take the alternating sum starting with +\leftover{+} on the ones digit 66 from right to left (starting with −- on the ones digit would flip the sign to −3≡8(mod11)-3 \equiv 8 \pmod{11}):
6,418,756≡+6−5+7−8+1−4+6\displaystyle 6{,}418{,}756 \equiv +6 - 5 + 7 - 8 + 1 - 4 + 6 =3(mod11)\displaystyle = \leftover{3} \pmod{11}
The remainders are 44, 11, and 33.
2

To test whether a number is divisible by 2424, a student checks whether it is divisible by 44 and by 66, since 24=4×624 = 4 \times 6. Explain why this rule fails, give a counterexample, and state a valid pair of divisibility tests for 2424.

Write out the prime factors of 2424, 44, and 66: how many factors of 22 does 2424 require, and how many are actually guaranteed when 44 and 66 both divide a number?

Why it failsA multiple of 24=2×2×2×324 = \two{2} \times \two{2} \times \two{2} \times \three{3} must contain three factors of 2\two{2} and one factor of 3\three{3}. Because 4=2×24 = \two{2} \times \two{2} and 6=2×36 = \two{2} \times \three{3} share a common factor of 2\two{2}, the two tests overlap and only guarantee two factors of 2\two{2} and one factor of 3\three{3} (a multiple of 1212) instead of three factors of 2\two{2}.
Counterexample1212 (or 3636) is divisible by both 44 (12=4×312 = 4 \times 3) and 66 (12=6×212 = 6 \times 2), but is not divisible by 2424.
Valid testSplit 2424 into 3\three{3} and 8\two{8} (do not pick 22 and 1212, which still share a factor of 22 and fail on 1212). Because 3\three{3} and 8=2×2×2\two{8} = \two{2} \times \two{2} \times \two{2} share no common factors greater than 11, a number is divisible by 2424 if and only if it is divisible by both 3\three{3} and 8\two{8}.
3

The seven-digit number 4,1A5,27B4{,}1\target{A}5{,}27\target{B} is divisible by 7272, where A\target{A} and B\target{B} are single digits (00 through 99). Find A\target{A} and B\target{B}.

Split 7272 into two factors that share no common factors greater than 11. Which of the two tests involves only one of the unknown digits so you can solve for it first?

Split 7272Since 72=8×972 = \two{8} \times \three{9} and 8\two{8} and 9\three{9} share no common factors greater than 11, the number must be divisible by both 8\two{8} and 9\three{9}.
Find B\target{B} using mod 88For divisibility by 88, the last three digits 27B27\target{B} must be a multiple of 88 (be careful not to check only the last two digits 7B7\target{B} as in the mod 44 rule, which would also allow B=6\target{B} = 6). Since 272=8×34272 = \whole{8 \times 34} is the only multiple of 88 between 270270 and 279279, we get B=2\target{B} = 2.
Find A\target{A} using mod 99Substitute B=2\target{B} = 2 into the digit sum (forgetting to include B=2\target{B} = 2 in the sum gives 19+A=2719 + \target{A} = 27 and the wrong answer A=8\target{A} = 8):
4+1+A+5+2+7+2\displaystyle 4 + 1 + \target{A} + 5 + 2 + 7 + 2 =21+A≡0(mod9)\displaystyle = 21 + \target{A} \equiv \clean{0} \pmod 9
The only multiple of 99 reachable with a single digit A\target{A} is 27\whole{27}, giving 21+A=2721 + \target{A} = \whole{27}. A=6\target{A} = 6 and B=2\target{B} = 2.
4

Find the last digit of 34,7193^{4{,}719}.

Multiply powers of 33 in mod 1010 until the ones digit hits 11. How long is the loop, and what rule gives the remainder of the exponent 4,7194{,}719 modulo that loop length?

Find the loop mod 1010Multiply by 33 and keep only the last digit at each step:
31≡3,32≡9,33=27≡7,34≡7×3=21≡1(mod10)\displaystyle \begin{aligned} 3^1 & &&\equiv \leftover{3}, \\ 3^2 & &&\equiv \leftover{9}, \\ 3^3 &= 27 &&\equiv \leftover{7}, \\ 3^4 &\equiv \leftover{7} \times 3 = 21 &&\equiv \leftover{1} \pmod{10} \end{aligned}
The last digits repeat in a cycle of 44: 3→9→7→1\leftover{3} \to \leftover{9} \to \leftover{7} \to \leftover{1}.
Reduce the exponent mod 44Use the divisibility rule for 44 on the exponent 4,7194{,}719 by keeping its last two digits (do not reduce the exponent mod 1010 to get 99, and do not stop at the exponent's remainder 33 as if it were the final answer):
4,719≡19\displaystyle 4{,}719 \equiv 19 =4×4+3≡3(mod4)\displaystyle = \whole{4 \times 4} + \leftover{3} \equiv \leftover{3} \pmod 4
Evaluate mod 1010Break out the 1,179\whole{1{,}179} full loops of 44:
34,719=(34)1,179×33≡11,179×7=7(mod10)\displaystyle \begin{aligned} 3^{4{,}719} &= \whole{(3^4)^{1{,}179}} \times \leftover{3^3} \\ &\equiv \whole{1^{1{,}179}} \times \leftover{7} = \leftover{7} \pmod{10} \end{aligned}
The last digit is 77.
5

Find the last two digits of 6071,535607^{1{,}535}.

Which modulus gives the last two digits of a number, and what does the base 607607 simplify to in that modulus before you take any powers?

Reduce the base mod 100100Throw away the hundreds place of the base first:
607\displaystyle 607 =600+7≡7(mod100)\displaystyle = \whole{600} + \leftover{7} \equiv \leftover{7} \pmod{100}
Find the loop mod 100100Multiply by 77 and keep the last two digits at each step (keep both the tens and ones digits so you don't drop the 44 in 343≡43343 \equiv 43 and get 0303):
71≡07,72≡49,73=343≡43,74≡43×7=301≡01(mod100)\displaystyle \begin{aligned} 7^1 & &&\equiv \leftover{07}, \\ 7^2 & &&\equiv \leftover{49}, \\ 7^3 &= 343 &&\equiv \leftover{43}, \\ 7^4 &\equiv \leftover{43} \times 7 \\ &= 301 &&\equiv \leftover{01} \pmod{100} \end{aligned}
The last two digits repeat in a cycle of 44.
Reduce the exponent mod 44 and evaluateCheck the last two digits of the exponent 1,5351{,}535 mod 44:
1,535≡35\displaystyle 1{,}535 \equiv 35 =4×8+3≡3(mod4)\displaystyle = \whole{4 \times 8} + \leftover{3} \equiv \leftover{3} \pmod 4
Substitute 1,535=4×383+31{,}535 = \whole{4 \times 383} + \leftover{3} into the power mod 100100:
6071,535≡71,535=(74)383×73≡1383×43=43(mod100)\displaystyle \begin{aligned} 607^{1{,}535} &\equiv \leftover{7}^{1{,}535} \\ &= \whole{(7^4)^{383}} \times \leftover{7^3} \\ &\equiv \whole{1^{383}} \times \leftover{43} \\ &= \leftover{43} \pmod{100} \end{aligned}
The last two digits are 4343.
6

Find the remainder when 212,025+102,02521^{2{,}025} + 10^{2{,}025} is divided by 1111.

Look at how close the bases 2121 and 1010 are to multiples of 1111 (22\whole{22} and 11\whole{11}) so you can rewrite both bases before raising them to the 2,0252{,}025th power.

Rewrite each base using negative remainders mod 1111Notice that both 2121 and 1010 are 11 short of a multiple of 1111 (be careful not to write 21≡+1(mod11)21 \equiv +1 \pmod{11} by confusing 22−122 - 1 with 22+122 + 1, which would cancel the two terms to 00):
21=22−1≡−1(mod11),10=11−1≡−1(mod11)\displaystyle \begin{aligned} 21 &= \whole{22} - \leftover{1} \equiv \leftover{-1} \pmod{11}, \\ 10 &= \whole{11} - \leftover{1} \equiv \leftover{-1} \pmod{11} \end{aligned}
Evaluate the odd powers and convert to a positive remainderBecause the exponent 2,0252{,}025 is odd, (−1)2,025=−1\leftover{(-1)^{2{,}025}} = \leftover{-1}. Add the two terms and add 1111 to convert the negative remainder (don't just drop the minus sign to get 22):
212,025+102,025≡(−1)2,025+(−1)2,025=−1+(−1)=−2≡9(mod11)\displaystyle \begin{aligned} & 21^{2{,}025} + 10^{2{,}025} \\ &\equiv \leftover{(-1)^{2{,}025}} + \leftover{(-1)^{2{,}025}} \\ &= \leftover{-1} + (\leftover{-1}) = -2 \\ &\equiv \leftover{9} \pmod{11} \end{aligned}
The remainder is 99.
7

Let n=dk10k+⋯+d2102+d110+d0n = d_k 10^k + \dots + d_2 10^2 + d_1 10 + d_0 be the base-1010 expansion of a positive integer nn. Using congruence mod 44, prove that n≡2d1+d0(mod4)n \equiv \target{2d_1 + d_0} \pmod 4, and conclude that nn is divisible by 44 if and only if 2d1+d0\target{2d_1 + d_0} is divisible by 44.

Find the remainder of 10i(mod4)10^i \pmod 4 separately for i≥2i \ge 2 and for i=1i = 1, then substitute both into the base-1010 expansion of nn.

Reduce the powers of 1010 mod 44Since 100=4×25≡0(mod4)100 = \whole{4 \times 25} \equiv \clean{0} \pmod 4, every power 10i10^i with i≥2i \ge 2 can be factored as 100×10i−2\whole{100} \times 10^{i-2} and becomes 0(mod4)\clean{0} \pmod 4:
10i\displaystyle 10^i =100×10i−2≡0×10i−2\displaystyle = \whole{100} \times 10^{i-2} \equiv \clean{0} \times 10^{i-2} =0(mod4)for all i\displaystyle = \clean{0} \pmod 4 \quad \text{for all } i ≥2\displaystyle \ge 2
For the tens place (i=1i = 1), 1010 is not congruent to 00 or 11 mod 44 (treating 10≡1(mod4)10 \equiv 1 \pmod 4 like the mod 99 rule would wrongly give d1+d0d_1 + d_0):
10\displaystyle 10 =4×2+2≡2(mod4)\displaystyle = \whole{4 \times 2} + \leftover{2} \equiv \leftover{2} \pmod 4
Substitute into the base-1010 expansion of nnReplace 10i10^i for i≥2i \ge 2 with 0\clean{0} and 1010 with 2\leftover{2} in the expansion of nn:
n=dk10k+⋯+d2102+d110+d0≡dk(0)+⋯+d2(0)+d1(2)+d0=2d1+d0(mod4)\displaystyle \begin{aligned} n &= d_k 10^k + \dots + d_2 10^2 \\ &\quad + d_1 10 + d_0 \\ &\equiv d_k(\clean{0}) + \dots + d_2(\clean{0}) \\ &\quad + d_1(\leftover{2}) + d_0 \\ &= \target{2d_1 + d_0} \pmod 4 \end{aligned}
Conclude the "if and only if" divisibility testBecause n≡2d1+d0(mod4)n \equiv \target{2d_1 + d_0} \pmod 4, nn and 2d1+d0\target{2d_1 + d_0} leave the exact same remainder when divided by 44. Therefore, n≡0(mod4)n \equiv \clean{0} \pmod 4 if and only if 2d1+d0≡0(mod4)\target{2d_1 + d_0} \equiv \clean{0} \pmod 4, which means nn is divisible by 44 if and only if 2d1+d0\target{2d_1 + d_0} is divisible by 44.