Find 5 digit number that any 3 digit number it contains is divisible by 17 or 23

testtest88

New member
Joined
Nov 18, 2015
Messages
2
Here is the question for my 12 year old.
Any idea as how to start this type of questions?
Thanks a million.

Find the number of 5-digit numbers less than 40000 in which the 3 3-digit numbers formed by consecutive digits are all divisible by either 17 or 23. Remember, zero cannot be the first digit in a 3-digit number.Remember, zero cannot be the first digit in a 3-digit number.
 
Not that I have a solution but just to see if I understand:
Let
N5 = a *104 + b 103 + c 102 + d 10 + e; a, b, and c not zero.
N31 = a *102 + b 10 + c
N32 = b *102 + c 10 + d
N33 = c *102 + d 10 + e
Find all N5 less than 40000 such that N31 , N32 , and N33 are divisible by either 17 or 23.

Seems to me that you would have eight cases you need to investigate. That is
(1) N31 divisible by 17, N32 divisible by 17, and N33 divisible by 17
(2) N31 divisible by 17, N32 divisible by 17, and N33 divisible by 23
(3) N31 divisible by 17, N32 divisible by 23, and N33 divisible by 17
(4) N31 divisible by 17, N32 divisible by 23, and N33 divisible by 23
...

Not seeing any other way right off hand, I would probably brute force it. You could set up some general equations which needed to be satisfied in a spread sheet and pick out corresponding groups. For example, for (1) you would need
a1 = n*17 - int(n*17/100)*100 [= b 10 + c above] > 10
b1 = int(10*a1/17)
c1 = (b1+1)*17
d1 = int(c1 / 10)
If d1 = a1 then you have constructed a number which satisfies N31 and N32 above. Now work on N33 the same way. Oh, and the eight cases could be set up in such a way as to only need to change at most 2 numbers to get each individual case.

Or you could just write a computer program to get the numbers which might be simpler.
 
Last edited:
thanks a lot for your replies

It looks like no simple tricky solutions. I will just tell my kid to use bruce force approach.Thanks.
 
Top