I came across this problem when searching for triangular numbers questions.
I know that I need to use the equation, $$\frac {n(n+1)}{2} $$ but I don't know how to apply it to this problem.
I came across this problem when searching for triangular numbers questions.
I know that I need to use the equation, $$\frac {n(n+1)}{2} $$ but I don't know how to apply it to this problem.
Copyright © 2021 JogjaFile Inc.
Here's one approach: If $n - 2014$ is a triangular number, then
$$n = \frac{k(k + 1)}{2} + 2014$$
for some integer $k$. Since $n + 2014$ is also a triangular number,
$$n = \frac{l(l + 1)}{2} - 2014$$
for some integer $l$. It follows that
$$k(k + 1) + 4028 = l (l + 1) - 4028$$
Rearranging this, we get
$$l^2 + l - k^2 - k = 8056$$ Now since $l^2 - k^2$ is a difference of squares, we can factor the left-hand side as
\begin{align*} 2^3 \cdot 19 \cdot 53 = 8056 = (l - k)(l + k) + (l - k) = (l - k)(l + k + 1) \end{align*}
Hence $l - k$ must be one of the (exactly) $4 \cdot 2 \cdot 2 = 16$ divisors of $8056$, as must $l + k + 1$. This is extremely limiting.