TITLE: Find a pair $(n, k)$ such that $\sum_{i=1}^{n} i = \sum_{i=1}^{k} i^2$?
QUESTION [6 upvotes]: How could I find all the pairs $(n, k)$ for this equation. The most obvious pair solution that I can see is $(1, 1)$.
Using summation identity, I have:
$$\frac{n(n+1)}{2} = \frac{k(k + 1)(2k + 1)}{6}$$
Then I thought of using cubic formula for $k$-equation, but it involved many variables. Any idea?   
Thanks,
Chan

REPLY [6 votes]: There are only two variables involved.  If you want to search, you can write it as a quadratic in $n$, just try values of $k$, solve for $n$, and see if it comes out integral.  I find k=5, n=10, k=6, n=13 and k=85, n=645 as solutions as well with no more under k=200.  Then OEIS has no more and asserts the series is finite.  There are references for this claim in A053611

REPLY [3 votes]: Fix the variable $k$. Let 
$$k' = \dfrac{k(k+1)(2k+1)}{6}.$$ 
Then you get the quadratic equation 
$$n^2+n-2k' = 0$$
with the solutions
$$n_{1/2} = -\dfrac{1}{2} \pm \sqrt{(\dfrac{1}{2})^2+2k'}.$$
Now you can generate your solution pairs.