Exercise 1.3.8 (A test for divisibility by $7$.)

A test for divisibility by 7 . Starting with any positive integer n , subtract double the units digit from the integer obtain from n by removing the unit digit, giving a smaller integer r . For example, if n = 41283 with unit digit 3 , we subtract 6 from 4128 to get r = 4122 . The problem is to prove that if either n or r is divisible by 7 , so is the other. This gives a test for divisibility by 7 by repeating the process. From 41283 we pass to 4122 , then to 408 by subtracting 4 from 412 , and then to 24 by subtracting 16 from 40 . Since 24 is not divisible by 7 , neither is 41283 .

Answers

Proof. Let n = a m a m 1 a 0 ¯ = i = 0 m a i 1 0 i . The integer n obtained by removing the unit digit is

n = a m a m 1 a 1 ¯ = n a 0 10 .

Then

r = n 2 a 0 = n a 0 10 2 a 0 = n 21 a 0 10 .

Now we prove

r = n 2 a 0 = n 21 a 0 10 5 n ( mod 7 ) .

( 5 is the inverse of 10 modulo 7 .)

Indeed, n 21 a 0 10 is an integer, and since 7 is prime with 10 ,

7 ( 5 n n 21 a 0 10 ) 7 10 ( 5 n n 21 a 0 10 ) 7 50 n n + 21 a 0 = 49 n + 21 a 0 = 7 ( 7 + 3 a 0 ) .

Since the last proposition is true, this shows that

r 5 n ( mod 7 ) .

Therefore 7 n if and only if 7 5 n , if and only if 7 r . If either n or r is divisible by 7 , so is the other. □

User profile picture
2024-10-03 09:29
Comments