# Sum of Two Triangular Numbers

1. Mar 22, 2006

### AKG

Which number can be expressed as the sum of two triangular numbers? I don't even know how to start with this one. Here is some data:

If you don't count 0 as a triangular number, then the following can:

2
4
6
7
9
11
12
13
16
18
20
21
22
24
25
27
29
30
31
34
36
37

And these can't:

3
5
8
10
14
15
17
19
23
26
28
32
33
35

If you do count 0 as one, then the following can:

2
3
4
6
7
9
10
11
12
13
15
16
18
20
21
22
24
25
27
28
29
30
31
34
36
37

And these can't:

5
8
14
17
19
23
26
32
33
35

Unlike the sum of two squares problem, you don't get anything so nice like if a and b are the sum of two triangles, then so is ab. Also, with sums of two squares, there's the fact if p is an odd prime, then p is a sum of two squares iff p = 1 (mod 4). Again, nothing as nice appears to be true for triangle numbers (even if you replace mod 4 with mod 3 or other small primes, or so it seems).

2. Mar 22, 2006

### Hurkyl

Staff Emeritus
5, 8
14, 17 (= 5 + 9, 8 + 9)
23, 26 (= 14 + 9, 17 + 9)
32, 35 (= 23 + 9, 26 + 9)
With 19 and 33 the only ones remaining.

Maybe it's just a spurious pattern that arises because we're only looking at very small numbers, though.

3. Mar 22, 2006

### Hurkyl

Staff Emeritus
Another thing that may or may not be useful: observe that the sum of the m-th and n-th triangular numbers is:

$$\frac{m(m+1)}{2} + \frac{n(n+1)}{2} = \frac{1}{2} \left( \left(m + \frac{1}{2}\right)^2 + \left(n + \frac{1}{2}\right)^2 - \frac{1}{2} \right)$$

Maybe you could apply some of the reasoning for the sum of two squares to this case, through an affine transformation.