A triangular number is a positive integer of the form n(n + 1)/2. Show that m is a sum of two triangular numbers iff 4m + 1 is a sum of two squares.
Solution
4 ( a(a+1)/2 + b(b+1)/2 ) + 1 = 2a2 + 2a + 2b2 + 2b + 1 = (a - b)2 + (a + b + 1)2.
If A2 + B2 = 1 (mod 4), then one of A, B must be odd and the other even. Hence (A + B - 1) and (A - B - 1) are both even. Put C = (A + B - 1)/2, D = (A - B - 1)/2. Then 1/2 C(C + 1) + 1/2 D(D + 1) = 1/8 ( (A + B - 1)(A + B + 1) + (A - B - 1)(A - B + 1) ) = 1/8 ( (A + B)2 - 1 + (A - B)2 - 1) = 1/4 ( A2 + B2 - 1). So if A2 + B2 = 4m + 1, then m = 1/2 C(C + 1) + 1/2 D(D + 1).
© John Scholes
jscholes@kalva.demon.co.uk
27 Jan 2001