[Math] Three different examples of three consecutive triangular numbers whose sum is a perfect square for n > or equal to 20

elementary-number-theory

Three different examples of three consecutive triangular numbers whose sum is a perfect square for n > or equal to 20. (In other words their sum must be greater than or equal to 400 and must be a perfect square).

I can use a program such as maple to write a script for it but I don't know where to even begin.

Using Joffan's suggestion I wrote out

$\frac{1}{2} j(j+1) + \frac{1}{2} k(k+1) + \frac{1}{2} l(l+1) = m^2 $

I am just not certain how I can translate this into maple's input language.

Best Answer

OK you have two different questions... programming in Maple is probably taken elsewhere, but I will say that for most programs, clarity is more important than efficiency. So having separate variables for your triangular numbers and for the square you're aiming at is fine if that makes your program clearer.

For mathematical analysis, though, if two items are related it's best to make that as explicit as possible. So your:

$\frac{1}{2} j(j+1) + \frac{1}{2} k(k+1) + \frac{1}{2} l(l+1) = m^2 $

since we're talking about $T_{k-1}+T_{k}+T_{k+1}, \to j=k-1$ and $l=k+1$ we can write as

$\frac{1}{2} (k-1)(k) + \frac{1}{2} k(k+1) + \frac{1}{2} (k+1)(k+2) = m^2 $

which could be simplified - or, more directly: $$\begin{align} T_{k-1}+T_{k}+T_{k+1} &= (T_{k} - k)+T_{k}+(T_{k}+(k+1))\\ &= 3T_k+1\\ &= 3\frac{1}{2}(k^2+k) + 1 \end{align}$$

which might help - it certainly shows that $m$ cannot be a multiple of 3.

Related Question