MathDB
2020 EGMO P6: m such that 3-term linear recurrence is always a square

Source: 2020 EGMO P6

April 18, 2020
EGMO 2020SequencePerfect SquaresEGMO

Problem Statement

Let m>1m > 1 be an integer. A sequence a1,a2,a3,a_1, a_2, a_3, \ldots is defined by a1=a2=1a_1 = a_2 = 1, a3=4a_3 = 4, and for all n4n \ge 4, an=m(an1+an2)an3.a_n = m(a_{n - 1} + a_{n - 2}) - a_{n - 3}.
Determine all integers mm such that every term of the sequence is a square.