# When can $n^k+k$ be a perfect square?

For what positive integers $k$ does there exist a positive integer $n$ such that $n^k+k$ is a perfect square?

Certainly for all $k$ such that $k+1$ is a perfect square, since we can substitute $n=1$.

For $k=2$, we have that $n^2+2$ is a perfect square, but modulo $4$ this cannot occur. For other even values of $k$, we get that two perfect squares must differ by $k$, which restricts the possibility to just $n=1$, and we covered that in the previous paragraph.

So the hard case remains with odd values of $k$.

• There are no solutions for $2\le n\le10^{~5}$ and odd $k\le25$. – Lucian Dec 18 '14 at 16:53
• For $2\le k\le 30$ and $2\le n \le 10^8$, there are no solutions. – Peter Dec 19 '14 at 9:51
• For $2\le k \le 1000$ and $2\le n \le 10^5$, there are no solutions. – Peter Dec 19 '14 at 10:51
• If $k \ge 5$, then a non-trivial solution must be greater than $10^{40}$. – Peter Dec 19 '14 at 10:59
• If $k=3$, then $n$ must be greater than $2*10^9$ to produce a non-trivial solution. – Peter Dec 19 '14 at 11:53

The case $k=3$ asks about $y^2=n^3+3$, which is a special case of the Mordell equation, $y^2=n^3+A$. A tremendous amount of work has been done on the Mordell equation, and solutions have been tabulated for large ranges of values of $A$, for example, here. At that site you will find it stated that $y^2=n^3+3$ has only the solution $n=1$.