# Find the sequence of integers that satisfies a recursive condition.

We have a natural number $$n\geq4$$ and the set A= {$$a_{1},a_{2},...,a_{n}$$} with natural numbers. We know $$a_{k}+k\sqrt{a_{k+1}} \in A$$ for every $$k \in \{{1,2,...,n-2}\}$$. We also know that $$a_{1}. Knowing that $$\sum_{k=1}^{n}a_{k}$$ is a perfect square, find $$A$$.

So we have $$a_{k}+k\sqrt{a_{k+1}}=a_{q}$$. We can easily see that $$q>k$$ so $$a_{q}>a_{k}$$ for a fixed k. Also we find out that $$k\sqrt{a_{k+1}}$$ is a natural number so $$a_{k+1}$$ is a perfect square for every $$k \in \{1,2,3,...,n-2 \}$$. From here we can say $$a_{2},a_{3},...,a_{n-1}$$ are perfect squares. Another interesting thing is the fact that $$a_{n-2}+(n-2)\sqrt{a_{n-1}} \in \{a_{n-1},a_{n}\}$$. Let's say $$a_{k}=p_{k}^{2}$$, for $$k \in \{2,3,...,n-1\}$$, and $$p_{k}$$ a natural number. Obviously if $$i>j$$, then $$p_{i}>p_{j}$$. Let's say $$\sum_{k=1}^{n}a_{k}=P^{2}$$, where $$P$$ is a natural number. We have $$a_{1}+a_{n}+\sum_{k=2}^{n-1}p_{k}^{2}=P$$. This is where I got stuck. Can someone give me an idea/hint?

• Do you consider $0$ a natural number? Commented Jun 27, 2023 at 19:09
• @Servaes I know number theorists say that 0 is not a natural number, but because this is a problem for 7/8 graders, I think we can say 0 is natural as they are taught. But I don't know how this question is relevant to this problem. Commented Jun 27, 2023 at 20:32
• Opinions differ on whether $0\in\Bbb{N}$. (Any number theorist I know uses the convention $0\in\Bbb{N}$). If $0\notin\Bbb{N}$ you can immediately conclude that $a_1\geq1$, and from there quite quickly that $a_k\geq k^2$ for $k\in\{1,\ldots,n-1\}$. If $0\in\Bbb{N}$ then you only get $a_k\geq(k-1)^2$. Makes quite a difference in how good or bad the algebra turn out, that's why I asked. Commented Jun 28, 2023 at 3:47
• @Servaes FYI, re: $0 \in \mathbb{N}$ for this question is a moot point as it only makes a difference if $a_1 = 0$. In that case, for $k=1$, we get $a_k+k\sqrt{a_{k+1}}=\sqrt{a_2}\in A$. Due to $a_i$ being strictly increasing, this means $\sqrt{a_2}=a_2\;\to\;a_2=1$. For $k=2$, we then get $1+2\sqrt{a_3}\in A$, so $a_3$ must be of the form $j^2$ for some $j \ge 2$. If $a_3=4$, then $5 \in A$, but for $j \ge 3$, then $a_2\lt 1+2\sqrt{a_3}\lt a_3$, so it's not possible. Thus, then $n=4$ with $A=\{0,1,4,5\}$, but $\sum_{k=1}^{4}a_k=10$ is not a perfect square, so it's not a solution. Commented Jun 28, 2023 at 4:19
• @JohnOmielan Thanks, eliminating $a_1=0$ is even better. This doesn't seem like a problem for 7/8 graders though. Commented Jun 28, 2023 at 4:26

Due to the $$a_i$$ sequence being strictly increasing, as you already noted, we have

$$a_{k}+k\sqrt{a_{k+1}}=a_{q} \tag{1}\label{eq1A}$$

with $$q \gt k$$. Note that, as $$k$$ increases, $$q - k$$ is a non-decreasing function. Thus, since $$q \le n$$ at $$k = n-2$$, then $$q-k$$ is always either $$1$$ or $$2$$. For $$k = 1$$, consider if

$$a_{1}+\sqrt{a_{2}} = a_{3} \tag{2}\label{eq2A}$$

Since $$a_{2}$$ and $$a_{3}$$ are both perfect squares, and $$a_{3} \gt a_{2}$$, we then have

$$\sqrt{a_{3}} = \sqrt{a_{2}} + j_{2}, \;\; j_2 \ge 1 \tag{3}\label{eq3A}$$

Substituting this into \eqref{eq2A} gives

\begin{aligned} a_{1}+\sqrt{a_{2}} & = (\sqrt{a_{2}} + j_2)^2 \\ a_{1}+\sqrt{a_{2}} & = a_{2} + 2j_2\sqrt{a_{2}} + j_2^2 \\ a_{1} & = a_{2} + (2j_2 - 1)\sqrt{a_{2}} + j_2^2 \end{aligned}\tag{4}\label{eq4A}

However, since $$(2j_2 - 1)\sqrt{a_{2}} \gt 0$$ and $$j_2^2 \gt 0$$, then \eqref{eq4A} indicates that $$a_{1} \gt a_{2}$$, contradicting the requirement $$a_{2} \gt a_{1}$$. Thus, we must instead have that

$$a_1 + \sqrt{a_2} = a_2 \tag{5}\label{eq5A}$$

Next, consider if

\begin{aligned} a_2 + 2\sqrt{a_3} & = a_3 \\ a_2 + 1 & = a_3 - 2\sqrt{a_3} + 1 \\ a_2 + 1 & = (\sqrt{a_3} - 1)^2 \end{aligned}\tag{6}\label{eq6A}

However, $$0$$ is the only perfect square that, when $$1$$ is added to it, gives another perfect square. Since $$a_2 \gt 0$$, this is not possible. Thus, we must instead have

$$a_2 + 2\sqrt{a_3} = a_4 \tag{7}\label{eq7A}$$

If $$n \gt 4$$, then $$a_4$$ must be a perfect square so, similar to \eqref{eq3A}, we get

$$\sqrt{a_4} = \sqrt{a_3} + j_3, \;\; j_3 \ge 1 \tag{8}\label{eq8A}$$

Using this in \eqref{eq7A} results in

\begin{aligned} a_2 + 2\sqrt{a_3} & = (\sqrt{a_3} + j_3)^2 \\ a_2 + 2\sqrt{a_3} & = a_3 + 2j_3\sqrt{a_3} + j_3^2 \\ a_2 & = a_3 + 2(j_3-1)\sqrt{a_3} + j_3^2 \end{aligned}\tag{9}\label{eq9A}

Since $$2(j_3-1)\sqrt{a_3} \ge 0$$ and $$j_3^2 \gt 0$$, this gives $$a_2 \gt a_3$$, which is not allowed. Thus, $$a_4$$ can't be a perfect square, so $$n = 4$$. Next, we have

$$a_4 = a_3 + j_4, \;\; j_4 \ge 1 \tag{10}\label{eq10A}$$

Using this in \eqref{eq7A} gives that

\begin{aligned} a_2 & = (a_3 + j_4) - 2\sqrt{a_3} \\ & = (a_3 - 2\sqrt{a_3} + 1) + j_4 - 1 \\ & = (\sqrt{a_3} - 1)^2 + j_4 - 1 \end{aligned}\tag{11}\label{eq11A}

Since $$\sqrt{a_3} - 1 \ge \sqrt{a_2} \;\;\to\;\; (\sqrt{a_3} - 1)^2 \ge a_2$$ and $$j_4 - 1 \ge 0$$, we must have

$$\sqrt{a_3} = \sqrt{a_2} + 1, \;\; j_4 = 1 \tag{12}\label{eq12A}$$

With $$\sum_{k=1}^{n}a_k=m^2$$ for some integer $$m$$, and letting $$\sqrt{a_2} = r$$ for simpler algebra, then using \eqref{eq5A}, \eqref{eq10A} and \eqref{eq12A} gives

\begin{aligned} m^2 & = a_1 + a_2 + a_3 + a_4 \\ & = (a_2 - \sqrt{a_2}) + a_2 + (\sqrt{a_2} + 1)^2 + ((\sqrt{a_2} + 1)^2 + 1) \\ & = (r^2 - r) + r^2 + (r + 1)^2 + ((r + 1)^2 + 1) \\ & = 4r^2 + 3r + 3 \end{aligned}\tag{13}\label{eq13A}

Since for $$r \gt 0$$ we have $$(2r)^2$$ being too small and $$(2r+2)^2 = 4r^2 + 8r + 4$$ being too large, the only possibility is $$m = 2r+1 \;\;\to\;\; m^2 = 4r^2 + 4r + 1$$, so

$$4r^2 + 4r + 1 = 4r^2 + 3r + 3 \;\;\to\;\; r = 2 \tag{14}\label{eq14A}$$

Thus, $$a_1 = 2^2 - 2 = 2$$, $$a_2 = 2^2 = 4$$, $$a_3 = (2 + 1)^2 = 9$$ and $$a_4 = 9 + 1 = 10$$, giving that $$A = \{2, 4, 9, 10\}$$.

• Thank you so much! Interesting answer! Commented Jun 28, 2023 at 11:32