Originally Posted by

**HallsofIvy** So the number is . Any number divisible by both 8 and 9 is necessarily divisble by 6 so we really only need to check "divisible by 8", divisible by 7" and "divisible by 9".

To be divisible by 8, the first **three** digits must make a number divisible by : 008, 016, 024, 032, 040, 048, etc.

To be divisible by 9, the sum of the digits must be divisible by 9: 1+9+ 8+ 4= 22 so 22+ a+ b+ c+ d must be divisible by 9.

22+ 0+ 0+ 8= 30

22+ 0+ 1+ 6= 29

22+ 0+ 2+ 4= 28

22+ 0+ 3+ 2= 27 is divisible by 9 so 1984a032 is a candidat

22+ 0+ 4+ 0= 26

22+ 0+ 4+ 8= 34

22+ 0+ 5+ 6= 33

22+ 0+ 6+ 4= 32

22+ 0+ 7+ 2= 31

22+ 0+ 8+ 0= 30

22+ 0+ 8+ 8= 38

22+ 0+ 9+ 6= 37

22+ 1+ 0+ 4= 27 so 1984a104 is a candidate, etc.

A number is divisible by 7 if and only if after taking the last digit off the number, doubling that last digit and subtracting from the truncated number, the result is divisible by 7. For example 805 is divisible by 7 because we drop the last digit, 5, we have 80. Subtracting 2(5)= 10 from that gives 70 which is obviously divisible by 7.