This is an interesting question I came across, and it does not look that easy:
$365$ can be written as a sum of $2$ consecutive squares and also $3$ consecutive squares:
$$ \large 365 = 14^2 + 13^2 = 12^2 + 11^2 + 10^2$$
What is the next number with this property? Give the last $3$ digits of the number.
The squares cannot be zero.
(I have no idea what is the deal with "last $3$ digits" part, but this is the original form of the problem)
The problem reduces to, $$k^2+(k+1)^2=(n-1)^2+n^2+(n+1)^2\tag1$$
or simply,
$$2k^2+2k-1 = 3n^2\tag2$$
Making a quadratic into a square is a well-studied subject. The complete solution is given by,
$$k = \frac{3p^2\pm6pq+4q^2}{3p^2-2q^2}$$
where $3p^2-2q^2=1$. We can transform this condition into a more conventional Pell equation by using the substitutions (the trick is described in this post),
$$p,\,q = u^2+4uv+6v^2,\quad u^2+6uv+6v^2$$
and $u,\pm v$ solve,
$$u^2-6v^2=1$$
Substitute $\displaystyle k = \frac{3p^2\pm6pq+4q^2}{3p^2-2q^2}$ into the LHS of $(1)$ and we get,
$$F_{\pm}(u,v):= k^2+(k+1)^2 = \frac{45 p^4 \pm 108 p^3 q + 120 p^2 q^2 \pm 72 p q^3 + 20 q^4}{(3p^2-2q^2)^2}$$
bearing in mind that $p,\,q = u^2+4uv+6v^2,\; u^2+6uv+6v^2$ and $u^2-6v^2=1$. Thus,
$$F_-(1,0) = 5$$ $$F_+(1,0) = 365$$ $$F_+(5,-2) = 35645$$ $$F_-(5,-2) = 3492725$$ $$F_-(5,2) = 342251285$$ $$F_+(5,2) = 33537133085$$
which are indeed the first few terms of the sequence A007667.
The $k$ are,
$$k =1, 13, 133, 1321, 13081, 129493,\dots$$
which is sequence A031138 and also defined as,
$$1^5+2^5+3^5+\dots+k^5 = y^2$$
Example:
$$1^5+2^5+3^5+\dots+13^5 = 1001^2$$
The $n$ are,
$$n = 1, 11, 109, 1079, 10681, 105731,\dots$$
which is A054320 though more interestingly (as A253475),
$$x=\frac{n+1}{2} = 1, 6, 55, 540, 5341, 52866, 523315,\dots$$
with a complementary sequence A054318,
$$y = 1, 5, 45, 441, 4361, 43165, 427285,\dots$$
then,
$$x^2 + (-x + 1)^2 = y^3 + (-y + 1)^3$$
$$4x(x\pm1)+1 = \text{square}$$
$$6y(y-1)+1 = \text{square}$$
Thus, the rather simple original equation turns out to involve relations between second, third, and fifth powers.