Let $m > 1$ be an integer. A sequence $a_1, a_2, a_3, \ldots$ is defined by $a_1 = a_2 = 1$, $a_3 = 4$, and for all $n \ge 4$, $$a_n = m(a_{n - 1} + a_{n - 2}) - a_{n - 3}.$$ Determine all integers $m$ such that every term of the sequence is a square.
Problem
Source: 2020 EGMO P6
Tags: EGMO 2020, Sequence, Perfect Squares, EGMO
19.04.2020 01:37
We have $a_4=5m-1, a_6=5m^3+8m^2-2m-4$. Then $4a_4a_6$ should be a perfect square, but for $m > 10$ we have \[(10m^2+7m-7)^2 < 4a_4a_6 < (10m^2+7m-6)^2.\]We are left to check $2\leq m\leq 10$. Only $m=2, 10$ make $a_4$ a perfect square. We claim that both of these cases work. For $m=2$, we have $a_n=b_n^2$ where \begin{align*} b_1 &=b_2=1, \\ b_n &= b_{n-1}+b_{n-2} \end{align*}(the Fibonacci numbers) and for $m=10$, we have $a_n=b_n^2$ where \begin{align*} b_1 &=-1, \quad b_2=1, \\ b_n &=3b_{n-1}+b_{n-2}.
19.04.2020 02:45
Feel silly posting this since same method but uglier The answer is $m=2$ and $m=10$. The verification they work is left as an exercise. Now compute the first several terms: \begin{align*} a_1 &= 1 \\ a_2 &= 1 \\ a_3 &= 4 \\ a_4 &= 5m-1 \\ a_5 &= 5m^2+3m-1 \\ a_6 &= 5m^3+8m^2-2m-4. \end{align*} We will now prove: Claim: If $a_4 \cdot a_6$ is a square then $m \in \{2,10\}$. Proof. A computation gives \begin{align*} 16 a_4 a_6 &= 400 m^4 + 560 m^3 - 288 m^2 - 288 m + 64 \\ &= \left(20m^2+14m-\frac{121}{10} \right)^2 + \frac{508}{10}m - \frac{8241}{100}. \end{align*}Let $A = 200m^2+140m-121 \equiv -1 \pmod{20}$. Then $42A+441 > 5080m-8241$ for all $m$ and hence \[ A^2 < \underbrace{A^2+5080m-8241}_{=1600a_3a_5} < (A+21)^2. \]But the inner term is the square of a multiple of $20$ so it must equal $(A+1)^2$. Thus, we have \[ 2(\underbrace{200m^2+140m-121}_{=A})+1 = 5080m-8241 \implies m \in \{2,10\} \]as desired. $\blacksquare$ Remark: In general, if $f(x) \in {\mathbb Z}[x]$ has even degree and the leading coefficient is a square, then $f(x)$ should be a square finitely often (unless $f$ is itself the square of a polynomial). The proof proceeds along the same lines, by bounding $f$ between two squares. See China TST 2001 for example which asked students to determine all $x$ for which \[ f(x) = x^6 + 15x^5 + 85x^4 + 225x^3 + 274x^2 + 120x + 1 \]was equal to a perfect square.
19.04.2020 09:06
a1267ab wrote: For $m=2$, we have $a_n=b_n^2$ where \begin{align*} b_1 &=b_2=1, \\ b_n &= b_{n-1}+b_{n-2} \end{align*}(the Fibonacci numbers) and for $m=10$, we have $a_n=b_n^2$ where \begin{align*} b_1 &=-1, \quad b_2=1, \\ b_n &=3b_{n-1}+b_{n-2}.
Just for a quicker finish, note that for $m=2$, $$2(b_{n-1}^2+b_{n-2}^2)-b_{n-3}^2 = (b_{n-1}+b_{n-2})^2+(b_{n-1}-b_{n-2})^2-b_{n-3}^2 = b_n^2+b_{n-3}^2-b_{n-3}^2=b_n^2$$ and for $m=10$, $$10(b_{n-1}^2+b_{n-2}^2)-b_{n-3}^2 = (3b_{n-1}+b_{n-2})^2+(b_{n-1}-3b_{n-2})^2-b_{n-3}^2 = b_n^2+b_{n-3}^2-b_{n-3}^2=b_n^2$$
19.04.2020 14:39
Note that $a_4=5m-1$, $a_5=5m^2+3m-1$, $a_6=5m^3+8m^2-2m-4$ and they all must be a perfect squares, therefore $4a_{4}a_{6}=4(5m-1)(5m^3+8m^2-2m-4)=100m^4+140m^3-72m^2-72m+16$ also must be a perfect square. Note that: $(10m^2+ 7m - 7)^2< 4a_{4}a_{6}<(10m^2+7m - 4)^2$ for all positive integers $m$ We conclude that $4a_{4}a_{6}=(10m^2+7m-6)^2$ or $(10m^2+7m-5 )^2$. In the second case we does not have any integer solutions, but in the first case we obtain solutions $m=2$, $m=10$. If $m=2$, then we can easily prove that by induction that $a_{n}=F_{n}^2$, where $F_n$ is Fibonacci number. If $m=10$, then we can easily prove by induction that $a_{n+2}=(\sqrt a_{n} + 3\sqrt a_{n+1})^2$
20.04.2020 13:05
v_Enhance wrote: Remark: In general, if $f(x) \in {\mathbb Z}[x]$ has even degree and the leading coefficient is a square, then $f(x)$ should be a square finitely often (unless $f$ is itself the square of a polynomial). The proof proceeds along the same lines, by bounding $f$ between two squares. See China TST 2001 for example which asked students to determine all $x$ for which \[ f(x) = x^6 + 15x^5 + 85x^4 + 225x^3 + 274x^2 + 120x + 1 \]was equal to a perfect square. I cannot see it at the China TST 2001 collection
20.04.2020 13:59
I'm not sure it's posted on AoPS.
20.04.2020 14:02
Could you then tell me where I can find this problem? Thanks.
20.04.2020 14:07
Well, the thing I wrote is the problem statement I heard about this problem second-hand in high school about eight years ago, so I don't have a source.
21.04.2020 00:21
Suppose a prime number $p>3$ divides $m-1$. Taking the reccurence modulo $p$, we get $$a_n=a_{n-1}+a_{n-2}-a_{n-3}.$$We can solve this difference equation in any standard way, and we obtain $a_{2n+1}=3n+1$ (well technically the equality is mod $p$, but it still works). Now, there exists a positive integer $n$ such that $3n+1$ is not a quadratic residue mod $p$, which is a contradiction. Therefore, $m-1$ is only divisible by $2$ and $3$. Suppose $m-1$ is divisible by $4$. Consider the equation modulo $4$. We get $a_4=4+1-1=0$, $a_5=4+4-1=3$, but $3$ is not a square modulo $4$, therefore $m-1$ is not divisible by $4$. Let $m=2^a3^b+1$ for $a, b \geqslant 0$, $a<2$. Then $a_4=5(2^a3^b+1)-1=5\cdot2^a3^b+4$. If $a=1$, then $a_4=2$ modulo $4$, so $a=0$. $$5\cdot3^b+4=x^2 \iff 5\cdot3^b=(x-2)(x+2),$$and since $x-2$ and $x+2$ are coprime, we have either $x-2=3^b$, $x+2=5$ $\implies b=0$, or $x-2=5$, $x+2=3^b$ $\implies b=2$. Now to prove that $m=2$ and $m=10$ are solutions, we guess (from initial terms) the two-term difference equation which the square roots of the original sequence satisfy. Let $a_n=b_n^2$. We can then prove by induction that if $m=2$, then $b_n=b_{n-1}+b_{n-2}$, and if $m=10$, then $b_n=3b_{n-1}+b_{n-2}$. Therefore, the solution set is $\{2,10\}$.
21.04.2020 01:02
Orestis_Lignos wrote: v_Enhance wrote: Remark: In general, if $f(x) \in {\mathbb Z}[x]$ has even degree and the leading coefficient is a square, then $f(x)$ should be a square finitely often (unless $f$ is itself the square of a polynomial). The proof proceeds along the same lines, by bounding $f$ between two squares. See China TST 2001 for example which asked students to determine all $x$ for which \[ f(x) = x^6 + 15x^5 + 85x^4 + 225x^3 + 274x^2 + 120x + 1 \]was equal to a perfect square. I cannot see it at the China TST 2001 collection v_Enhance wrote: I'm not sure it's posted on AoPS. Orestis_Lignos wrote: Could you then tell me where I can find this problem? Thanks. v_Enhance wrote: Well, the thing I wrote is the problem statement I heard about this problem second-hand in high school about eight years ago, so I don't have a source. here it is , indeed in China TST 2001, in (A) as problem 3 not all of China TST 2001 are posted in aops, here they are in Chinese
21.04.2020 01:48
Finally, (again) posting for storage; solved with TheUltimate123. The answer is $m=2$ and $m=10$. Both solutions can be verified as follows. For $m=2$, note the sequence $a_n = b_n^2$, where $b_1 = b_2 = 1$ and $b_n = b_{n-1} + b_{n-2}$ for $n \geq 3$. For $m=10$, note the sequence $a_n = c_n^2$, where $c_1 = -1$, $c_2 = 1$, and $c_n = 3c_{n-1} + c_{n-2}$ for $n \geq 3$. We now show uniqueness. First, calculate $(a_4, a_6) = (5m-1, 5m^3 + 8m^2 - 2m - 4)$. We then proceed to the following claim. Claim. The product $4a_4a_6$ is a square only if $m \leq 10$. Proof. Compute the product \[4a_4a_6 = 100m^4 + 140m^3 - 72m^2 - 72m + 16.\]Now note that \[(10m^2 + 7m - 7)^2 < 100m^4 + 140m^3 - 72m^2 - 72m + 16 < (10m^2 + 7m - 6)^2\]for all $m > 10$, so the middle quantity cannot be a square as desired. $\square$ Finally, verify that $5m-1$ is not a square for any $m < 10$ and $m \neq 2, 10$. Thus, the only solutions are $2$ and $10$, as desired.
22.04.2020 07:36
02.05.2020 11:02
I claim that the only values of $m$ are $2$ and $10$. We will prove that these values work For $m = 10$, we can start by listing a few values of $a_n$ $a_1 = a_2 = 1$ $a_3 = 4$ $a_4 = 49$ $a_5 = 529$ $a_6 = 5776$ Observe that if $\sqrt{a_n} = p_n$ and $p_1 = -1$ and $p_2 = 1$ then $p_n = 3p_{n-1} + p_{n-2}$ for all $n$ $\geq 3$ Similarly for $m = 2$, observe that if $\sqrt{a_n} = q_n$ and $q_1 = 1$ and $q_2 = 1$ then $q_n = q_{n-1} + q_{n-2}$ for all $n$ $\geq 3$ Now we prove that no other values of $n$ work Observe that $$(a_3)(a_4)(a_6) = 100m^4 + 140m^3 - 72m^2 - 72m + 4$$ Also observe that $$(10m^2 + 7m - 7)^2 < (a_3)(a_4)(a_6) < (10m^2 + 7m - 6)^2$$for all $m > 10$. Now we know that $m$ has to be less than or equal to $10$ and we can do a manual check to see that only the values $m = 2, 10$ work.
15.06.2020 03:25
I think this works?
12.04.2021 14:45
Idio-logy wrote:
Hello, but I think that it's $G_{n+2}=3G_{n+1}-G_n$
25.08.2021 10:58
Pathological wrote: Observe that $t^n \sqrt{r_2} = \sqrt{m-1} \cdot t^{n-1} \sqrt{r_2} + t^{n-2} \sqrt{r_2}$ for all $n \ge C$, Hello, I don't understand this line. It is equivalent to: $ t^2 = \sqrt{m-1} \cdot t + 1$, which is not correct
31.12.2021 22:20
We have $a_1=1$. $a_2=1$. $a_3=4$. $a_4=5m-1$. $a_5=5m^2+3m-1$. $a_6=5m^3+8m^2-2m-4$. Consider the value $b=4\cdot a_4\cdot a_6$, which must be a perfect square. We have \[b=4\cdot (5m-1)(5m^3+8m^2-2m-4)=4\cdot (25m^4+40m^3-10m^2-20m-5m^3-8m^2+2m+4)=4\cdot (25m^4+35m^3-18m^2-18m+4)=100m^4+140m^3-72m^2-72m+16.\] Note \[(10m^2+7m-7)^2=100m^4+140m^3-91m^2-98m+49\]and \[(10m^2+7m-6)^2=100m^4+140m^3-71m^2-84m+36.\] So we either need $b\le (10m^2+7m-7)^2$ or $b\ge (10m^2+7m-6)^2$. Case 1: $b\le (10m^2+7m-7)^2$. Then \[100m^4+140m^3-72m^2-72m+16\le 100m^4+140m^3-91m^2-98m+49\implies -72m^2-72m+16\le -91m^2-98m+49\implies 19m^2+26m-33\le0,\]which is not true for any positive integer $m$. Case 2: $b\ge (10m^2+7m-6)^2$. Then \[100m^4+140m^3-72m^2-72m+16\ge 100m^4+140m^3-71m^2-84m+36\implies -72m^2-72m+16\ge -71m^2-84m+36\implies m^2-12m+20=(m-10)(m-2)\le 0\] This is only true when $2\le m\le 10$. Now we will show that $3\le m\le 9$ doesn't work. For $m=3$, $5m-1=14$, not a perfect square. For $m=4$, $5m-1=19$, not a perfect square. For $m=5$, $5m-1=24$, not a perfect square. For $m=6$, $5m-1=29$, not a perfect square. For $m=7$, $5m-1=34$, not a perfect square. For $m=8$, $5m-1=39$, not a perfect square. For $m=9$, $5m-1=44$, not a perfect square. Thus, it suffices to show that $\boxed{m=2}$ and $\boxed{m=10}$ work. First, we will show for $m=2$. We claim that $a_n=F_n^2$, where $F_n$ is the $n$th Fibonacci number. We will show this by induction. Base cases are $a_1,a_2,a_3,a_4$. Suppose it is true for $a_{n-1}, a_{n-2}, a_{n-3}$. Then we have \[a_n=2F_{n-1}^2+2F_{n-2}^2-F_{n-3}^2=2F_{n-1}^2+2F_{n-2}^2-(F_{n-1}-F_{n-2})^2=F_{n-1}^2+F_{n-2}^2+2F_{n-1}F_{n-2}=(F_{n-1}+F_{n-2})^2=F_n^2,\]which completes the induction. Now we will show for $m=10$. Consider the first few terms of the sequence, $-1^2, 1^2, 2^2, 7^2, 23^2, 76^2$. We claim $a_n=b_n^2$, where $b_n$ is the sequence with $b_1=-1$, $b_2=1$, and for $n\ge 3$, $b_n=3b_{n-1}+b_{n-2}$. We will show this by induction (base cases, $a_1,a_2,a_3,a_4,a_5,a_6$). Suppose it's true for $a_{n-1}$, $a_{n-2}$, and for $a_{n-3}$. Then \[a_n=10b_{n-1}^2+10b_{n-2}^2-b_{n-3}^2=10b_{n-1}^2+10b_{n-2}^2-(b_{n-1}-3b_{n-2})^2=9b_{n-1}^2+b_{n-2}^2+6b_{n-1}b_{n-2}=(3b_{n-1}+b_{n-2})^2=b_n^2,\]which completes the induction.
18.01.2022 07:46
Remark: I also solved the problem with bounding something between two squares, but I realized this is a very interesting way of looking at this problem. I am surprised if bashing small terms is really the intended sol.
27.11.2022 19:53
01.12.2023 18:09
Welp it looks like I overcomplicated this. Need to try bounding at all times. Here's a sketch: If we take $\pmod {m-1}$ then all values $1,4,7,\dots$ are QRs, hence for $m\neq 2$ we should get $m\equiv 1\pmod 3$. (After eliminating $m=3$.) Now it follows that there exist (by Pigeonhole) exactly two solutions to \[x^2\equiv r\pmod {3k}\]for $m=3k+1$ and $r\neq 0\pmod 3$. Some divisibility analysis (CRT) gives $3k\in \{3^d,2\cdot 3^d\}$. The point now is that by DoS: \[5(3k+1)-1=x^2\implies 15k=x^2-4=(x-2)(x+2)\]and in both cases we find $d\le 2$ as $x\ge 3^d-2$. Hence only $3,6,9,18$ can be possible values for $3k$, and only $3k=9\implies m=10$ works. Now induction proves that the answers are $m\in \{2,10\}$.
09.02.2024 01:21
First, taking mod $m-1$, we obtain the sequence $1, 1, 4, 4, 7, 7, \dots$. Since all terms of the sequence are perfect squares, this means that \[ \frac{m-1}{3^{\nu_3(m-1)}} \in \{1, 2\}, \]since $1$ and $2$ are the only moduli under which all residues are QRs. Note that for some integer $a$, \[ 5m-1 = a^2, \]or equivalently, \[ 5(m-1) = (a-2)(a+2). \]Since $m-1$ is either $3^k$ or $2 \cdot 3^k$ for some integer $k$, it follows by casework on the ternary representations of $a-2$ and $a+2$ that either $m=2$ or $m=10$. We will show that both $m=2$ and $m=10$ work. Case 1, $\color{blue} m=2$: By induction, it can be shown that $a_n=F_n^2$, where $F_n$ is the $n$th Fibonacci number. Case 2, $\color{blue} m=10$: By induction, it can be shown that $a_n=T_n^2$, where $T_n$ is the $n$th term of the sequence defined by $T_n=3T_{n-1}+T_{n-2}$ for $n \ge 4$. We conclude.