Math Core

Module 3.1 · Number Theory

Divisibility rules

Contest problems love hidden digits: "The number 7A38B7A38B is divisible by 7272. Find AA." You can't try all hundred digit pairs in the time you have. Divisibility rules let you test a number without dividing, and they turn missing-digit puzzles into two short equations.

The rules you should know cold

DivisorTest
22Last digit is even.
33Digit sum is divisible by 33.
44Last two digits form a multiple of 44.
55Last digit is 00 or 55.
66Divisible by both 22 and 33.
88Last three digits form a multiple of 88.
99Digit sum is divisible by 99.
1010Last digit is 00.
1111Alternating sum of digits (add, subtract, add, …) is divisible by 1111.

Why they work

The rules come from how powers of 1010 behave.

  • Last-digit rules (2, 4, 5, 8, 10). 1010 is divisible by 22 and 55, 100100 is divisible by 44, and 10001000 is divisible by 88. So in 75,384=75,000+38475{,}384 = 75{,}000 + 384, the 75,00075{,}000 part is automatically a multiple of 88. Only the last three digits, 384384, can spoil divisibility by 88.
  • Digit-sum rules (3, 9). Every power of 1010 is one more than a multiple of 99: 10=9+110 = 9 + 1, 100=99+1100 = 99 + 1, and so on. So 4⋅100+5⋅10+64 \cdot 100 + 5 \cdot 10 + 6 is (4+5+6)(4 + 5 + 6) plus a multiple of 99. The number and its digit sum leave the same remainder when divided by 99 (and by 33).
  • Alternating rule (11). 10=11−110 = 11 - 1, 100=99+1100 = 99 + 1, 1000=1001−11000 = 1001 - 1, … The powers of 1010 are alternately one less and one more than a multiple of 1111. That is why the digits get alternating signs.

Combine rules for composite divisors

To test divisibility by a composite number, split it into factors that share no common factor and test each one: 12=3⋅412 = 3 \cdot 4,   18=2⋅9\;18 = 2 \cdot 9,   36=4⋅9\;36 = 4 \cdot 9,   45=5⋅9\;45 = 5 \cdot 9,   72=8⋅9\;72 = 8 \cdot 9,   88=8⋅11\;88 = 8 \cdot 11.

Common mistake

The factors must share no common factor. Being divisible by 44 and by 66 does not mean divisible by 2424. For example, 1212 is divisible by both, but not by 2424. Use 24=3⋅824 = 3 \cdot 8 instead.

Worked examples

Worked example: The 11 test

Is 918,082918{,}082 divisible by 1111?

Alternating sum from the left: 9−1+8−0+8−2=229 - 1 + 8 - 0 + 8 - 2 = 22. Since 2222 is a multiple of 1111, so is 918,082918{,}082. (Indeed, 918,082=11×83,462918{,}082 = 11 \times 83{,}462.)

Worked example: Two unknown digits, divisor 45

The four-digit number 5A6B5A6B is divisible by 4545. How many such numbers are there?

45=5⋅945 = 5 \cdot 9. For divisibility by 55, B=0B = 0 or B=5B = 5.

  • If B=0B = 0: digit sum 5+A+6+0=11+A5 + A + 6 + 0 = 11 + A must be a multiple of 99, so A=7A = 7. The number is 57605760.
  • If B=5B = 5: digit sum 16+A16 + A must be a multiple of 99, so A=2A = 2. The number is 52655265.

There are 2 such numbers.

Worked example: Divisor 72: do the last digits first

The five-digit number 7A38B7A38B is divisible by 7272. Find A+BA + B.

72=8⋅972 = 8 \cdot 9. Start with 88, because it involves only the last three digits, 38B38B. Checking 380380 through 389389, only 384=8⋅48384 = 8 \cdot 48 works, so B=4B = 4.

Now the digit sum: 7+A+3+8+4=22+A7 + A + 3 + 8 + 4 = 22 + A. The next multiple of 99 is 2727, so A=5A = 5. (The one after, 3636, would need A=14A = 14.)

So A+B=9A + B = 9. Check: 75,384=72×104775{,}384 = 72 \times 1047.

Tip

When a problem has two unknown digits, handle the rule that pins down one digit first (the last-digit rules). Then the digit-sum or alternating-sum rule finishes the job.

Practice

Practice 1

Which of the following numbers is divisible by 99?

Practice 2

The four-digit number 3A523A52 is divisible by 33. How many different digits could AA be?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

The four-digit number 7d367d36 is divisible by 3636. What is the digit dd?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

The five-digit number 3A7293A729 is divisible by 1111. What is the digit AA?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Which of the following does not divide 1,234,567,8901{,}234{,}567{,}890?

Practice 6

The five-digit number 2A45B2A45B is divisible by 8888. What is A+BA + B?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

What is the smallest positive multiple of 3636 whose digits are all 44s and 00s?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

How many four-digit numbers of the form A‾ B‾ A‾ B‾\underline{A}\,\underline{B}\,\underline{A}\,\underline{B} (with A≠0A \ne 0) are divisible by both 99 and 44?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Real contest practice