Three different examples of three consecutive triangular numbers whose sum is a perfect square for n > or equal to 20 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.
 A: 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. 
A: I will expand the solution of @Joffan.
The numbers $k > 0$ such that $k^2$ is a sum of three consecutive triangle numbers (namely $T_{k-1}$, $T_k$, $T_{k+1}$) can be found in the OEIS database. Their generating function is 
$$\frac{x(1-x)(1+3x+x^2)}{1-10x^2+x^4}.$$
And what may be surprising they satisfy relatively simple recurrence relation: $a_n = 10a_{n-2}-a_{n-4}$, where $a_1 = 1$, $a_2 = 2$, $a_3=8$ and $a_4 = 19$.
A: For the equation:
$$\frac{a(a+1)}{2}+\frac{b(b+1)}{2}+\frac{c(c+1)}{2}=x^2$$
You can write the solution as:
$$a=-p^2+p-\frac{s(s+1)}{2}$$
$$b=-p^2-p-\frac{s(s+1)}{2}$$
$$c=s$$
$$x=p^2+\frac{s(s+1)}{2}$$
Or different.
$$a=-\frac{p(p+3)}{2}-s^2-s-1$$
$$b=-\frac{p(p+3)}{2}-s^2+s-1$$
$$c=-p-2$$
$$x=\frac{p(p+3)}{2}+s^2+1$$
$p,s$ - Integers asked us.  Not a lot not in a convenient form the recorded decision, but it is. Go to positive numbers is not difficult.
A: What about this equation:
$$\frac{(k-1)k}{2}+\frac{k(k+1)}{2}+\frac{(k+1)(k+2)}{2}=x^2$$
For this we need to use the solutions of the Pell equation.
$$p^2-6s^2=1$$
To find solutions easily. Knowing the first solution $(p_1;s_2)$ - $(5;2)$
Knowing one solution, the following can be found by the formula.
$$p_2=5p_1+12s_1$$
$$s_2=2p_1+5s_1$$
Knowing any solution and using it, you can find the solution to this equation by the formula.
$$k=p(4s-p)$$
$$x=p^2-3ps+6s^2$$
Or different formula.
$$k=-2p^2-8ps-6s^2$$
$$x=2p^2+9ps+12s^2$$
