9th Chinese 1994 Problem B3 X is the point (1994p, 7·1994p), where p is a prime, O is the point (0, 0). How many triangles XYZ have Y and Z at lattice points, incenter at O, and YXZ a right-angle? Solution
: 36 if p is not 2 or 997; 18 if p = 2; 20 if p = 997. Let us write u = 1994p. If the line YX has slope k, then it has equation (y - 7u) = k(x - u) or kx - y + 7u - ku = 0. Hence the distance from the origin is (v - ku)/(1 + k 2 ) 1/2 . The line ZX is perpendicular to XY, so it has equation k(y - 7u) + x - u = 0. Hence the distance from the origin is (u + kv)/(1 + k 2 ) 1/2 . These two distances must be equal, so | u + 7uk | = | 7u - ku |. Hence k = 3/4 or -4/3, but these are essentially the same solution, since they have product -1. So one line has slope 3/4 and the other slope -4/3. Hence the inradius r = 5u. So we may take Y as (u + 3n, 7u - 4n), Z as (u - 4m, 7u - 3m) for some integers m, n. The equation of YZ is then ( (u + 3n) - (u - 4m) )/( (7u - 4n) - (7u - 3m) ) = (x - (u - 4m)) /(y - (7u - 3m) ) or (3n + 4m)y + (4n - 3m)x - 25(nu + mu - mn) = 0. Hence the distance from the origin is 25(nu + mu - mn)/( (3n + 4m) 2 + (4n - 3m) 2 ) 1/2 = 5(nu + mu - mn)/(m 2 + n 2 ) 1/2 . This must equal 5u, so u 2 (m 2 + n 2 ) = (mu + nu - mn) 2 and hence 2u 2 - 2(m + n)u + mn = 0 (*). The incircle touches XY at (4u, 3u), so Y must be further from (4u, 3u) as X (otherwise YZ would meet XZ on the wrong side of X). So n > 2u. Similarly XZ touches the incircle at (-3u, 4u), and Z must be further from (-3u, 4u) than X, so m > 2u. Put m = 2u + M, n = 2u + N. Then (*) becomes: MN = 2u 2 . Now u = 1994p = 2.997.p, so 2u 2 = 2 3 p 2 997 2 . This has (5+1)(2+1) = 18 positive divisors if p = 2, (3+1)(4+1) = 20 if p = 997 and (3+1)(2+1)(2+1) = 36 otherwise. That gives the number of solutions in positive integers to MN = 2u 2 . 9th Chinese 1994 © John Scholes jscholes@kalva.demon.co.uk 25 June 2002