**Problem A1**Let d be any positive integer not equal to 2, 5 or 13. Show that one can find distinct a, b in the set {2, 5, 13, d} such that ab - 1 is not a perfect square.

**Solution**

Consider residues mod 16. A perfect square must be 0, 1, 4 or 9 (mod 16). d must be 1, 5, 9, or 13 for 2d - 1 to have one of these values. However, if d is 1 or 13, then 13d - 1 is not one of these values. If d is 5 or 9, then 5d - 1 is not one of these values. So we cannot have all three of 2d - 1, 5d - 1, 13d - 1 perfect squares.

*Alternative solution from Marco Dalai*

Suppose 2d-1, 5d-1, 13d-1 are all squares. Squares mod 4 must be 0 or 1, considering 2d-1, so d must be odd. Put d = 2k+1. Then 10k+4 = b^{2}. So b must be even, so k must be even. Put k = 2h, then 5k+1 is a square. Similarly, 52h+12 is a square, so 13h+3 is a square. Hence (13h+3)-(5h+1) = 8h+2 is a difference of two squares, which is impossible (a difference of two squares must be 0, 1, or 3 mod 4).

**Problem A2**Given a point P_{0} in the plane of the triangle A_{1}A_{2}A_{3}. Define A_{s} = A_{s-3} for all s ≥ 4. Construct a set of points P_{1}, P_{2}, P_{3}, ... such that P_{k+1} is the image of P_{k} under a rotation center A_{k+1} through 120^{o} clockwise for k = 0, 1, 2, ... . Prove that if P_{1986} = P_{0}, then the triangle A_{1}A_{2}A_{3} is equilateral.

**Solution**

The product of three successive rotations about the three vertices of a triangle must be a translation (see below). But that means that P_{1986} (which is the result of 662 such operations, since 1986 = 3 x 662) can only be P_{0} if it is the identity, for a translation by a non-zero amount would keep moving the point further away. It is now easy to show that it can only be the identity if the triangle is equilateral. Take a circle center A_{1}, radius A_{1}A_{2} and take P on the circle so that a 120^{o} clockwise rotation about A_{1} brings P to A_{2}. Take a circle center A_{3}, radius A_{3}A_{2} and take Q on the circle so that a 120^{o} clockwise rotation about A_{3} takes A_{2} to Q. Then successive 120^{o} clockwise rotations about A_{1}, A_{2}, A_{3} take P to Q. So if these three are equivalent to the identity we must have P = Q. Hence ∠A_{1}A_{2}A_{3} = ∠A_{1}A_{2}P + ∠A_{3}A_{2}P = 30^{o} + 30^{o} = 60^{o}. Also A_{2}P = 2A_{1}A_{2}cos 30^{o} and = 2A_{2}A_{3}cos 30^{o}. Hence A_{1}A_{2} = A_{2}A_{3}. So A_{1}A_{2}A_{2} is equilateral. Note in passing that it is not sufficient for the triangle to be equilateral. We also have to take the rotations in the right order. If we move around the vertices the opposite way, then we get a net translation.

It remains to show that the three rotations give a translation. Define rectangular coordinates (x, y) by taking A_{1} to be the origin and A_{2} to be (a, b). Let A_{3} be (c, d). A clockwise rotation through 120 degrees about the origin takes (x, y) to (-x/2 + y√3/2, -x√3/2 - y/2). A clockwise rotation through 120 degrees about some other point (e, f) is obtained by subtracting (e, f) to get (x - e, y - f), the coordinates relative to (e, f), then rotating, then adding (e, f) to get the coordinates relative to (0, 0). Thus after the three rotations we will end up with a linear combination of x's, y's, a's, b's, c's and d's for each coordinate. But the linear combination of x's and y's must be just x for the x-coordinate and y for the y-coordinate, since three successive 120 degree rotations about the same point is the identity. Hence we end up with simply (x + constant, y + constant), in other words, a translation.

[Of course, there is nothing to stop you actually carrying out the computation. It makes things slightly easier to take the triangle to be (0, 0), (1, 0), (a, b). The net result turns out to be (x, y) goes to (x + 3a/2 - b√3/2, y - √3 + a√3/2 + 3b/2). For this to be the identity requires a = 1/2, b = √3/2. So the third vertex must make the triangle equilateral (and it must be on the correct side of the line joining the other two). This approach avoids the need for the argument in the first paragraph above, but is rather harder work.]

**Problem A3**To each vertex of a regular pentagon an integer is assigned, so that the sum of all five numbers is positive. If three consecutive vertices are assigned the numbers x, y, z respectively, and y < 0, then the following operation is allowed: x, y, z are replaced by x + y, -y, z + y respectively. Such an operation is performed repeatedly as long as at least one of the five numbers is negative. Determine whether this procedure necessarily comes to an end after a finite number of steps.

**Solution**

Let S be the sum of the absolute value of each set of adjacent vertices, so if the integers are a, b, c, d, e, then S = |a| + |b| + |c| + |d| + |e| + |a + b| + |b + c| + |c + d| + |d + e| + |e + a| + |a + b + c| + |b + c + d| + |c + d + e| + |d + e + a| + |e + a + b| + |a + b + c + d| + |b + c + d + e| + |c + d + e + a| + |d + e + a + b| + |e + a + b + c| + |a + b + c + d + e|. Then the operation reduces S, but S is a greater than zero, so the process must terminate in a finite number of steps. So see that S is reduced, we can simply write out all the terms. Suppose the integers are a, b, c, d, e before the operation, and a+b, -b, b+c, d, e after it. We find that we mostly get the same terms before and after (although not in the same order), so that the sum S' after the operation is S - |a + c + d + e| + |a + 2b + c + d + e|. Certainly a + c + d + e > a + 2b + c + d + e since b is negative, and a + c + d + e > -(a + 2b+ c + d + e) because a + b + c + d + e > 0.

*S is not the only expression we can use. If we take T = (a - c)*^{2} + (b - d)^{2} + (c - e)^{2} + (d - a)^{2} +(e - b)^{2}, then after replacing a, b, c by a+b, -b, b+c, we get T' = T + 2b(a + b + c + d + e) < T. Thanks to Demetres Chrisofides for T

**Problem B1**Let A, B be adjacent vertices of a regular n-gon (n ≥ 5) with center O. A triangle XYZ, which is congruent to and initially coincides with OAB, moves in the plane in such a way that Y and Z each trace out the whole boundary of the polygon, with X remaining inside the polygon. Find the locus of X.

**Solution**

Take AB = 2 and let M be the midpoint of AB. Take coordinates with origin at A, x-axis as AB and y-axis directed inside the n-gon. Let Z move along AB from B towards A. Let ∠YZA be t. Let the coordinates of X be (x, y). ∠YZX = π/2 - π/n, so XZ = 1/sin π/n and y = XZ sin(t + π/2 - π/n) = sin t + cot π/n cos t.

BY sin 2π/n = YZ sin t = 2 sin t. MX = cot π/n. So x = MY cos t - BY cos 2π/n + MX sin t = cos t + (cot π/n - 2 cot 2π/n) sin t = cos t + tan π/n sin t = y tan π/n. Thus the locus of X is a star formed of n lines segments emanating from O. X moves out from O to the tip of a line segement and then back to O, then out along the next segment and so on. x^{2} + y^{2} = (1/sin^{2}π/n + 1/cos^{2}π/n) cos^{2}(t + π/n). Thus the length of each segment is (1 - cos π/n)/(sin π/n cos π/n).

**Problem B2**Find all functions f defined on the non-negative reals and taking non-negative real values such that: f(2) = 0, f(x) ≠ 0 for 0 ≤ x < 2, and f(xf(y)) f(y) = f(x + y) for all x, y.

**Solution**

f(x+2) = f(xf(2)) f(2) = 0. So f(x) = 0 for all x ≥ 2.

f(y) f((2-y)f(y)) = f(2) = 0. So if y < 2, then f((2-y) f(y)) = 0 and hence (2 - y) f(y) ≥ 2, or f(y) ≥ 2/(2 - y).

Suppose that for some y_{0} we have f(y_{0}) > 2/(2 - y_{0}), then we can find y_{1} > y_{0} (and y_{1} < 2) so that f(y_{0}) = 2/(2 - y_{1}). Now let x_{1} = 2 - y_{1}. Then f(x_{1}f(y_{0})) = f(2) = 0, so f(x_{1} + y_{0}) = 0. But x_{1} + y_{0} < 2. Contradiction. So we must have f(x) = 2/(2 - x) for all x < 2.

We have thus established that if a function f meets the conditions then it must be defined as above. It remains to prove that with this definition f does meet the conditions. Clearly f(2) = 0 and f(x) is non-zero for 0 ≤ x < 2. f(xf(y)) = f(2x/(2 - y)). If 2x/(2 - y) ≥ 2, then f(xf(y)) = 0. But it also follows that x + y ≥ 2, and so f(x + y) = 0 and hence f(xf(y)) f(y) = f(x + y) as required. If 2x/(2 - y) < 2, then f(xf(y)) f(y) = 2/(2 - 2x/(2-y)) 2/(2 - y) = 2/(2 - x - y) = f(x + y). So the unique function satisfying the conditions is:

f(x) = 0 for x ≥ 2, and 2/(2 - x) for 0 ≤ x < 2.

**Problem B3**Given a finite set of points in the plane, each with integer coordinates, is it always possible to color the points red or white so that for any straight line L parallel to one of the coordinate axes the difference (in absolute value) between the numbers of white and red points on L is not greater than 1?

**Solution**

Answer: yes.

We prove the result by induction on the number n of points. It is clearly true for n = 1. Suppose it is true for all numbers less than n. Pick an arbitrary point P and color it red. Now take a point in the same row and color it white. Take a point in the same column as the new point and color it red. Continue until either you run out of eligible points or you pick a point in the same column as P. The process must terminate because there are only finitely many points. Suppose the last point picked is Q. Let S be the set of points picked.

If Q is in the same column as P, then it is colored white (because the "same row" points are all white, and the "same column" points are all red). Now every row and column contains an equal number of red points of S and of white points of S. By induction we can color the points excluding those in S, then the difference between the numbers of red and white points in each row and column will be unaffected by adding the points in S and so we will have a coloring for the whole set. This completes the induction for the case where Q is in the same column as P.

If it is not, then continue the path backwards from P. In other words, pick a point in the same column as P and color it white. Then pick a point in the same row as the new point and color it red and so on. Continue until either you run out of eligible points or you pick a point to pair with Q. If Q was picked as being in the same row as its predecessor, this means a point in the same column as Q; if Q was picked as being in the same column as its predecessor, this means a point in the same row as Q. Again the process must terminate. Suppose the last point picked is R. Let S be the set of all points picked.

If R pairs with Q, then we can complete the coloring by induction as before. Suppose S does not pair with Q. Then there is a line (meaning a row or column) containing Q and no uncolored points. There is also a line containing R and no uncolored points. These two lines have an excess of one red or one white. All other lines contain equal number of red and white points of S. Now color the points outside S by induction. This gives a coloring for the whole set, because no line with a color excess in S has any points outside S. So we have completed the induction.