1

I'm trying to see if $$\frac{n(n^2+1) }{2}$$ can be a perfect square for $n$ a positive integer, but I have no idea how to...

1 Answers1

2

Observe that $n$ and $n^2+1$ are coprime. Also if $ab$ is square with coprime $a,b$, both $a,b$ must be square.

Now there are two cases:

Case 1: $n$ is even. Then both $\dfrac n2$ and $n^2+1$ are squares. In particular the latter condition forces $n=0$.

Case 2: $n$ is odd. Then both $n$ and $\dfrac {n^2+1}2$ are squares. Writing $n = x^2$ we have the equation $x^4+1 = 2y^2$ for some integer $y$. As shown here (Solve in $\mathbb{Z}$ the equation $x^4 + 1 = 2y^2$.), this equation only has trivial solutions $x = \pm1$, $y= \pm 1$, giving the unique solution $n=1$.


The solution there observes that $(x^2\pm1)^2 = 2y^2\pm2x^2$, and thus $(x^4-1)^2 = 4y^4-4x^4$.

From $x^4+1=2y^2$, $x$ is odd, so the equation can be rewritten as $y^4-x^4=\left(\dfrac {x^4-1}2\right)^2$, and by Fermat's Right Triangle Theorem there are no nontrivial solutions.

player3236
  • 16,413