If $1+n+n^2+n^3$ is a perfect square, then $n=1$ or $n=7$ I want to prove that if $1+n+n^2+n^3$ is a perfect square then $n=1$ or $n=7$.
I managed to prove that $1+n+n^2+n^3=(n^2+1)(n+1)$ and that $(n^2+1,n+1)$ is either $1$ or $2$.
I found out that it could not be $1$, and then $\frac{1}{2}(n^2+1,n+1)=1$.
From here I concluded that $n^2+1=2a^2$ and $n+1=2b^2$ for some $a,b\in\mathbb{N}$ and it is here where I need some help.
Please only provide hints.
 A: Hint: If $\gcd(n+1,n^2+1)=2$ then $n$ is odd, say $n=2k+1$, and so you get
$$a^2=\frac{n^2+1}{2}=\frac{4k^2+4k+2}{2}=k^2+(k+1)^2=k^2+b^4,$$
which is a Pythagorean triple. Can you continue from here? [There is still quite some work to be done!]
A: Note that the LHS is a 4-term GP with $a = 1, r = n$. The sum is
$${1(1 - n^4) \over (1 - n)} = {n^4 - 1 \over n-1}$$
So, the equation becomes,
$${n^4 - 1 \over n-1} = y^2$$
This is the Nagell–Ljunggren Equation whose general form is:
$${x^n - 1 \over x - 1} = y^q$$
where, $x > 1, y > 1, n > 2, q ≥ 2$.
Known solutions are:
$${3^5 - 1 \over 3 - 1} = 11^2, {7^4 - 1 \over 7 - 1} = 20^2, {18^3 - 1 \over 18 - 1} = 7^3$$
So, for the 4th power version of your problem, $(7, 20)$ is the only known solution. I am not sure if there are other solutions possible. Need to study the original paper.
References:
See 2.2.4 The Nagell–Ljunggren Equation in
Perfect Powers:
Pillai’s works and their developments
by M. Waldschmidt
https://webusers.imj-prg.fr/~michel.waldschmidt/articles/pdf/PerfectPowers.pdf
A: This is an old math olympiad problem.
The elementary solution involves repeated use of the well-known parametrization of Pythagorean triples (Euclid's formula).
You arrive at $n^2 + 1 = 2a^2$ and $n + 1 = 2b^2$, so that $2b^4 - 2b^2 + 1 = a^2$. Rewrite this as $(b^2)^2 + (b^2 - 1)^2 = a^2$ and use Euclid's formula.
Finally it gets down to Fermat's equations $x^4 \pm y^4 = z^2$, which have no non-trival solutions, as can be shown (again) by using Euclid's formula and infinite descent.

Nevertheless, a more advance approach is simply to view this as an elliptic curve and use a computer algebra system to find the integral points.
Run the following Sage code on Sage Cell Server to get the answer in no time:
EllipticCurve([0, 1, 0, 1, 1]).integral_points()

Output:
[(-1 : 0 : 1), (0 : 1 : 1), (1 : 2 : 1), (7 : 20 : 1)]

A: I. If $1+n+n^2+n^3=z^2$, and odd $n=2y+1$, then$$1+n+n^2+n^3=8y^3+16y^2+12y+4=z^2$$
Since $4$ divides $z^2$, then if $z^2=4w^2$ $$2y^3+4y^2+3y+1=w^2$$ and factoring $$(y+1)(2y^2+2y+1)=w^2$$
Now $y+1$ and $2y^2+2y+1$ are relatively prime, since if integer $k$ divides $y+1$, then $k$ divides $2y(y+1)=2y^2+2y$, and hence $k$ does not divide $2y^2+2y+1$.  If their product is square, then both $y+1$ and $2y^2+2y+1$ are squares.
II. Let $2y^2+2y+1$, which is odd, $=(2t+1)^2=4t^2+4t+1$.   Then$$y^2+y=2t^2+2t$$and$$\frac{y(y+1)}{2}=\frac{2t(t+1)}{2}$$Hence the LHS is a triangle number which is double a triangle number, and it lies in the sequence $$6,  210,  7140, 242556,   8239770,  279909630,  9508687656, ...$$and $y$ belongs in the sequence $$3, 20, 119, 696, 4059, 23660, 137903,...$$III. With a little more argument, drawing upon the sequence of solutions to the Pell equation$$b^2=2a^2 {^+_-} 1$$ it is possible to rule out all members of the $y$-sequence except $y=3$, and so prove that $n=7$.
I don't know if this approach is better than one by way of Pythagorean triples, but identifying $y$ as a factor in this relatively small sub-set of the triangle numbers seems a good way to go.
