m, n, r, s are positive integers such that: (1) m < n and r < s; (2) m and n are relatively prime, and r and s are relatively prime; and (3) tan-1m/n + tan-1r/s = π/4. Given m and n, find r and s. Given n and s, find m and r. Given m and s, find n and r.
Solution
Put k = tan-1m/n, h = tan-1r/s. Then h + k = π/4, so 1 = tan(h+k) = (tan h + tan k)/(1 - tan h tan k) = (r/s + m/n)/(1 - mr/ns) = (nr + ms)/(ns - mr). Hence (m+n)(r+s) = 2ns.
Suppose we are given m and n. We have (m+n)r = (n-m)s. If m and n have opposite parity, then m+n and m-n are coprime, so r = n-m, s = m+n. If m and n have the same parity, then m+n and m-n are both even, so r = (n-m)/2, s = (m+n)/2.
Suppose we are given n and s. wlog n ≥ s. If d > 1 divides n and d divides m+n, then d divides m and n. Contradiction. So n must divide r+s. But r < s ≤ n, so r+s < 2n. Hence r+s = n, so m+n = 2s. Hence n and s must be relatively prime and n < 2s.
Suppose we are given m and s. Then (m+n)(s-r) = 2ms. If d > 1 divides m and m+n, then d divides m and n. Contradiction. So m must divide s-r. So if d > 1 divides m and s, then d divides r, so r and s are not coprime. Contradiction. Hence m and s must be coprime. Also m must be < s. But now we can take r = s-m, n = 2s-m.
Thanks to Suat Namli
© John Scholes
jscholes@kalva.demon.co.uk
6 March 2004
Last corrected/updated 6 Mar 04