Maths Olympiad Prep

Library / /16 of 16

Combinatorics Difficulty 7.0 National olympiad, round 2 Prove it Czech Republic

On the table there are kk heaps of 1,2,,k1, 2, \dots, k stones, where k3k \ge 3. In the first step, we choose any three of the heaps on the table, merge them into a single new heap, and remove 1 stone (throw it away from the table) from this new heap. In the second step, we again merge some three of the heaps together into a single new heap, and then remove 2 stones from this new heap. In general, in the ii-th step we choose any three of the heaps, which contain more than ii stones when combined, we merge them into a single new heap, and then remove ii stones from this new heap. Assume that after a number of steps, there is a single heap left on the table, containing pp stones. Show that the number pp is a perfect square if and only if the numbers 2k+22k+2 and 3k+13k+1 are perfect squares. Further, find the least number kk for which pp is a perfect square.

Solution

After ii steps, there will be k2ik - 2i heaps left on the table; thus if a single heap is to remain in the end, the number kk must be odd and the total number of steps has to be 12(k1)\frac{1}{2}(k-1). Let us distinguish two cases, according as the remainder of kk upon division by 4 is 1 or 3.

The case of k=4c+1k = 4c + 1. In the beginning there are 1++k=12k(k+1)=(4c+1)(2c+1)1 + \dots + k = \frac{1}{2}k(k+1) = (4c+1)(2c+1) stones on the table, from which in course of the 2c2c steps we will remove 1++2c=c(2c+1)1 + \dots + 2c = c(2c+1) stones; thus the number of stones in the last heap will be
p=(4c+1)(2c+1)c(2c+1)=(2c+1)(3c+1). p = (4c+1)(2c+1) - c(2c+1) = (2c+1)(3c+1).
Since the numbers 2c+12c+1 and 3c+13c+1 are coprime, pp is a perfect square if and only if both 2c+12c+1 and 3c+13c+1 are perfect squares; that is, if and only if their quadruples 4(2c+1)=2k+24(2c+1) = 2k+2 and 4(3c+1)=3k+14(3c+1) = 3k+1 are perfect squares.

The case of k=4c+3k = 4c + 3. In the beginning there are 1++k=12k(k+1)=2(c+1)(4c+3)1 + \dots + k = \frac{1}{2}k(k+1) = 2(c+1)(4c+3) stones on the table, from which we remove in course of all the 2c+12c + 1 steps a total of 1++(2c+1)=(c+1)(2c+1)1 + \cdots + (2c + 1) = (c + 1)(2c + 1) stones; thus the last single heap will contain
p=2(c+1)(4c+3)(c+1)(2c+1)=(c+1)(6c+5). p = 2(c+1)(4c+3) - (c+1)(2c+1) = (c+1)(6c+5).
If pp were a perfect square, then so would have to be the two coprime numbers c+1c+1 and 6c+56c+5. Let us show that this is not possible. Assume that there exist natural numbers x,yx, y such that c+1=x2c+1 = x^2 and 6c+5=y26c+5 = y^2. From the equality 6x2y2=16x^2 - y^2 = 1 it follows that the number yy is odd, hence y2y^2 gives a remainder of 1 upon division by 8. The number 6x26x^2 then gives the remainder of 2, which implies that 3x23x^2 gives remainder 1 upon division by 4 — a contradiction. Hence in the case of k=4c+3k = 4c+3 the number pp is never a perfect square, and likewise the number 3k+1=12c+103k+1 = 12c+10 is never a perfect square (being an even number not divisible by 4).

Let us finally find the least number k=4c+1k = 4c+1, c1c \ge 1, for which both numbers 2c+12c+1 and 3c+13c+1 are perfect squares. From the equalities 2c+1=x22c+1 = x^2 and 3c+1=y23c+1 = y^2 for suitable integers x,y>1x, y > 1 it follows that 3x22y2=13x^2 - 2y^2 = 1, whence xx is odd, but then the number 2y22y^2 gives remainder 2 upon division by 4, so yy is also odd. Set x=2a+1x = 2a+1, y=2b+1y = 2b+1 (a,b>0a, b > 0 integer) and substitute this into the equality 3x22y2=13x^2 - 2y^2 = 1; upon a small manipulation this leads to the relation 3a(a+1)=2b(b+1)3a(a+1) = 2b(b+1), and taking successively a=1,2,a = 1, 2, \dots we soon find the smallest solution a=4a = 4 and b=5b = 5, corresponding to x=9,y=11,c=40x = 9, y = 11, c = 40 and k=161k = 161.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.