Maths WorkshopMaths problems with full solutions
Exercise 1959Number theory › Diophantine equationsOlympiadAdded 4 Nov 2026

When is n⁴ + n³ + n² + n + 1 a perfect square?

#bounding between squares#Diophantine equations

Statement

Find all positive integers nn such that N=n4+n3+n2+n+1N=n^4+n^3+n^2+n+1 is a perfect square.

Hint

Multiply by 44 to complete a square: compare 4N4N with (2n2+n)2(2n^2+n)^2 and (2n2+n+2)2(2n^2+n+2)^2.

Show solutionHide solution

Solution

Answer. n=3n=3 only (N=121=112N=121=11^2).

Idea. Trap 4N4N strictly between two consecutive squares of the same parity, leaving a single possible intermediate square, then solve for nn.

Bounds. We have
(2n2+n)2=4n4+4n3+n2<4N=4n4+4n3+4n2+4n+4,(2n^2+n)^2=4n^4+4n^3+n^2<4N=4n^4+4n^3+4n^2+4n+4,
and
(2n2+n+2)2=4n4+4n3+9n2+4n+4,(2n^2+n+2)^2=4n^4+4n^3+9n^2+4n+4,
so (2n2+n+2)2−4N=5n2>0(2n^2+n+2)^2-4N=5n^2>0. Hence
(2n2+n)2<4N<(2n2+n+2)2.(2n^2+n)^2<4N<(2n^2+n+2)^2.

Parity. If N=m2N=m^2 then 4N=(2m)24N=(2m)^2 is an even square strictly between the squares of 2n2+n2n^2+n and 2n2+n+22n^2+n+2, so 2m=2n2+n+12m=2n^2+n+1. Squaring,
4N=(2n2+n+1)2=4n4+4n3+5n2+2n+1,4N=(2n^2+n+1)^2=4n^4+4n^3+5n^2+2n+1,
and comparing with 4N=4n4+4n3+4n2+4n+44N=4n^4+4n^3+4n^2+4n+4 gives n2−2n−3=0n^2-2n-3=0, i.e. (n−3)(n+1)=0(n-3)(n+1)=0.

Conclusion. n=3n=3.

Check. 81+27+9+3+1=12181+27+9+3+1=121 ✓. (Compare: n=1n=1 gives 55, n=2n=2 gives 3131, n=4n=4 gives 341341.)

Lesson. To solve "polynomial = square", sandwich the polynomial (suitably scaled) between two consecutive squares and treat the few possible intermediate values.