ABC

cinelli
2 Lemon pips
Posts: 135
Joined: November 9th, 2016, 11:33 am
Has thanked: 29 times
Been thanked: 17 times

ABC

A. B and C are three positive whole numbers each composed of the same three digits. They satisfy the following conditions:

1) The difference between any two of A, B and C is divisible by 81 but not by 10 or 11.
2) A+B+C is divisible by 4.
3) A is divisible by 17.
4) B is less than C.

What are A, B and C?

Cinelli

Gengulphus
Lemon Quarter
Posts: 1911
Joined: November 4th, 2016, 1:17 am
Been thanked: 740 times

Re: ABC

cinelli wrote:A. B and C are three positive whole numbers each composed of the same three digits. They satisfy the following conditions:

1) The difference between any two of A, B and C is divisible by 81 but not by 10 or 11.
2) A+B+C is divisible by 4.
3) A is divisible by 17.
4) B is less than C.

What are A, B and C?

Cinelli

Spoiler...

First note that no two of A, B and C can be identical, as if they were, their difference would be 0, which is divisible by 10 and 11.

Let X, Y and Z be A, B and C sorted into ascending order, so X < Y < Z, and let the three digits that are used to compose A, B and C (and thus X, Y and Z) be i, j and k, with i <= j <= k. There are at most six numbers composed of those three digits, which are in ascending order:

* ijk, ikj, jik, jki, kij and kji if i < j < k
* iik, iki and kii if i = j < k
* ikk, kik and kki if i < j = k
* iii if i = j = k.

For each of those cases, if we pick three different numbers from the list (which we can do in 6 CHOOSE 3 = 20 ways for the first case, one way each for the 2nd and 3rd cases, and no ways at all for the 4th case), we can identify which of them is each of X, Y and Z because the ascending orders have to agree with each other.

That gives 20+1+1+0 = 22 possibilities, but most of them can be quickly disposed of by observing that we cannot have two numbers that share their 3rd digit, since then they differ by a multiple of 10, and we cannot have two numbers that share their 2nd digit, since they are then xyz and zyx for some digits x, y and z, and their difference xyz - zyx = (100x+10y+z) - (100z+10y+x) = 99(x-z) is divisible by 11. Running through the possibilities:

* ijk, ikj, jik with i < j < k: NO (shared 3rd digit)
* ijk, ikj, jki with i < j < k: NO (shared 2nd digit)
* ijk, ikj, kij with i < j < k: NO (shared 3rd digit)
* ijk, ikj, kji with i < j < k: NO (shared 2nd digit)
* ijk, jik, jki with i < j < k: NO (shared 3rd digit)
* ijk, jik, kij with i < j < k: NO (shared 2nd and 3rd digits)
* ijk, jik, kji with i < j < k: NO (shared 2nd and 3rd digits)
* ijk, jki, kij with i < j < k: POSSIBLE
* ijk, jki, kji with i < j < k: NO (shared 2nd and 3rd digits)
* ijk, kij, kji with i < j < k: NO (shared 2nd digit)
* ikj, jik, jki with i < j < k: NO (shared 2nd digit)
* ikj, jik, kij with i < j < k: NO (shared 2nd and 3rd digits)
* ikj, jik, kji with i < j < k: POSSIBLE
* ikj, jki, kij with i < j < k: NO (shared 2nd and 3rd digits)
* ikj, jki, kji with i < j < k: NO (shared 2nd and 3rd digits)
* ikj, kij, kji with i < j < k: NO (shared 3rd digit)
* jik, jki, kij with i < j < k: NO (shared 2nd digit)
* jik, jki, kji with i < j < k: NO (shared 3rd digit)
* jik, kij, kji with i < j < k: NO (shared 2nd digit)
* jki, kij, kji with i < j < k: NO (shared 3rd digit)
* iik, iki, kii with i = j < k: NO (shared 2nd and 3rd digits)
* ikk, kik, kki with i < j = k: NO (shared 2nd and 3rd digits)

So the only two possibilities left are X=ijk, Y=jki, Z=kij and X=ikj, Y=jik, Z= kji, in each case with i < j < k. In each of those two possibilities, A+B+C = X+Y+Z = 111(i+j+k), and since A+B+C is a multiple of 4, i+j+k must be a multiple of 4.

In each of those two possibilities, each difference between X, Y and Z is of the form +/-(pqr - rpq) for some p, q and r, and that is equal to +/-((100p+10q+r)-(100r+10p+q)) = +/-(90p+9q-99r) = +/-(81(p-r)+9(p+q-2r)). For that to be divisible by 81, p+q-2r must be divisible by 9. Also, there are differences of that type for each pair of i, j and k taking the roles of p and q, so i, j and k must be such that the sum of any two of them minus twice the third is a multiple of 9.

So we only need to look for i, j and k that make i+j-2k, j+k-2i and k+i-2j all be multiples of 9. Since i, j and k are distinct digits, each of them is at most 8+9-2*0 = 17 and at least 0+1-2*9 = -17, so each of them is -9, 0 or 9. Furthermore, since i < j < k, we have i+j-2k = (i-k)+(j-k) < 0 and j+k-2i = (j-i)+(k-i) > 0, so they must be 9 and -9 respectively, and noting that the sum of all three of i+j-2k, j+k-2i and k+i-2j is 0, we must have k+i-2j = 0. That tells us that k=2j-i, which when substituted in the i+j-2k = -9 and j+k-2i = 9 gives us 3i-3j = -9 and 3j-3i = 9 respectively. Those tell us that j = i+3, and substituting that back into k=2j-i, that k=i+6. That gives us four possibilities for (i,j,k), namely (0,3,6), (1,4,7), (2,5,8) and (3,6,9), and the fact that i+j+k must be a multiple of 4 then tells us that they must be (1,4,7).

So either X=147, Y=471 and Z=714 or X=174, Y=417 and Z=741. Of those numbers, only 714 is divisible by 17, so A=714, and the known order of B and C then implies that B=147 and C=471.

Gengulphus

Gengulphus
Lemon Quarter
Posts: 1911
Joined: November 4th, 2016, 1:17 am
Been thanked: 740 times

Re: ABC

Improvement to my spoiler...
Gengulphus wrote:That gives 20+1+1+0 = 22 possibilities, but most of them can be quickly disposed of by observing that we cannot have two numbers that share their 3rd digit, since then they differ by a multiple of 10, and we cannot have two numbers that share their 2nd digit, since they are then xyz and zyx for some digits x, y and z, and their difference xyz - zyx = (100x+10y+z) - (100z+10y+x) = 99(x-z) is divisible by 11. Running through the possibilities:
...
So the only two possibilities left are X=ijk, Y=jki, Z=kij and X=ikj, Y=jik, Z= kji, in each case with i < j < k. In each of those two possibilities, A+B+C = X+Y+Z = 111(i+j+k), and since A+B+C is a multiple of 4, i+j+k must be a multiple of 4.

Running through the 22 possibilities was a bit of unnecessary brute force. To get rid of it, having observed as above that neither the second digits nor the third digits of any pair of X, Y and Z can be the same, then consider the possibility that the first digits are the same. That would mean that two of X, Y and Z are xyz and xzy for some digits x, y and z. Then the third of them must have the same three digits, and y must be the first digit since it would otherwise be a shared 2nd or 3rd digit with one of xyz and xzy, and z must also be the first digit for the same reason. That's not possible, so no two of X, Y and Z can share any digit in the same place. So X must start with i, Y with j and Z with k, and the two possibilities X = ijk and X = ikj rapidly lead to the corresponding values Y=jki, Z=kij and Y=jik, Z=kji respectively.

Gengulphus

modellingman
2 Lemon pips
Posts: 151
Joined: November 4th, 2016, 3:46 pm
Has thanked: 26 times
Been thanked: 28 times

Re: ABC

I have only just read this. Here's a more arithmetic approach:

Following Gengulphus, let the digits be i,j and k. These cannot all be the same since B<C means A,B,C cannot all be the same. Further, if two digits were the same the 3 numbers would be ijj, jij and jji and the difference between the first and third of these is 99(i-j) which is a multiple of 11, contradicting the assumption about the differences between A, B and C, so i, j and k are all different.

Further, i, j and k must each occupy a different position in A, B and C. Again the proof is by contradiction. If the last digit (say k) is common to two numbers then the difference ijk - jik is 90(i-j) which is a multiple of 10. If the middle digit (say j) is common to two numbers then the difference ijk - kij is 99(i-k) which is a multiple of 11. If the first digit (say i) is common then the two numbers are ijk and ikj with the third number being one of the four possibilities jik, jki, kij, kji. For each of these possibilities either the middle or last digit is common to one of ijk or ikj, so in each case a difference exists that is a multiple of either 10 or 11. Thus, in all cases where a digit has the same position in two of numbers A, B and C, at least one difference in these numbers is a multiple of 10 or 11, contradicting the assumption.

If A is denoted by ijk then the different positions finding implies the other two numbers are necessarily kij and jki. It also follows from this that A+B+C=111*(i+j+k) and that if A+B+C is a multiple of 4, then the sum of the digits (i+j+k) is also a multiple of 4.

So far this has followed (nay, stolen) elements of Gengulphus' excellent solution, but now the tack changes.

A=ijk is a multiple of 17, so list all the 3 digit-multiples of 17. There are 58 of them starting with 017, 034, 051,... and ending with 986. All but 14 can be eliminated because the sum of their digits is not a multiple of 4. Of these 14 a further 5 (255, 323, 646, 884 and 969) can be eliminated because they fall foul of the requirement that i, j and k must all be different. For each of the remaining 9 multiples of 17 (017, 170, 187, 408, 493, 561, 578, 714, 952) calculate ijk - kij. In all but two cases (561 and 714) the calculated value is not divisible by 81 and, therefore, the only possibilities for A are 561 and 714

For ijk=561, ijk-jki is -54 which is not a multiple of 81, so A cannot be 561, leaving ijk=714 as the only possibility for A. Since B<C it follows that B=kij=147 and C=jki=471. The final step is to note that A-B=567, A-C=243 and C-B=324, with each result a multiple of 81 and no result a multiple of either 10 or 11. This confirms (A,B,C) = (714, 147, 471) as the sole solution.

cinelli
2 Lemon pips
Posts: 135
Joined: November 9th, 2016, 11:33 am
Has thanked: 29 times
Been thanked: 17 times

Re: ABC

I am going to return to this puzzle. But not for a while as I am having a few days away.

Cinelli

cinelli
2 Lemon pips
Posts: 135
Joined: November 9th, 2016, 11:33 am
Has thanked: 29 times
Been thanked: 17 times

Re: ABC

My method is similar to those of Gengulphus and modellingman but – dare I say? – shorter with less trial and error. Because of this I hope it is watertight.
Let A = ‘abc’, i.e. 100*a+10*b+c with 0 <= a, b, c <= 9. Then there are five possibilities for B and C: ‘acb’, ‘bac’, ‘bca’, ‘cab’, ‘cba’.
‘bac’ won’t work because when subtracted from A this leaves a multiple of 10.
‘cba’ won’t work because when subtracted from A this leaves 99(a-c), a multiple of 11.
Considering ‘acb’ for B or C the difference from A is 10(b-c)+(c-b) = 9(b-c). This could be a multiple of 81 but only if b=9 and c=0. But in this case A=’a90’ and not one of the nine possibilities 090, 190, 290, ..., 990 is a multiple of 17. So this case can be discounted.
This leaves just the two possibilities ‘bca’ and ‘cab’ for B and C. It is clear that a, b and c must be different or else a difference would be a multiple of ten, not allowed. If we calculate the difference between A and ‘bca' we get
A-‘bca’ = 100(a-b)+10(b-c)+(c-a) = 99a-90b-9c = 9(11a-10b-c). It must be then that 11a-10b-c is a multiple of nine:
11a-10b-c = 9p
We can absorb multiples of nine into the RHS to simplify this:
2a-b-c = 9u (i)
Similarly with the other two differences
2c-a-b = 9v (ii)
2b-c-a = 9w (iii)
Clearly u+v+w = 0. Also A+B+C is a multiple of four so
100(a+b+c)+10(a+b+c)+(a+b+c) = 111(a+b+c). So a+b+c is a multiple of four:
a+b+c = 4s (iv)
Because a, b and c are all different it must be that s is in the range 1 to 6. Moreover adding (i) to (iv) gives
3a = 9u+4s (v)
indicating that s is a multiple of 3. So s can be only 3 or 6. Equation (v) becomes
a = 3u+4t
where t is 1 or 2. Adding (ii) to (iv) and (iii) to (iv) gives the similar equations
b = 3v+4t
c = 3w+4t
So a, b and c differ by a multiple of three. Very little wriggle room means that a, b and c must be 1, 4 and 7. Thus A = ‘abc’ is one of just six possible values: 147, 174, 417, 471, 714 or 741. Only 714 is a multiple of 17 fixing B as 147 and C as 471.

Cinelli