## Task 1.

Determine all sequences $a: \mathbb{N} \rightarrow \mathbb{N}$ such that for all $n \in \mathbb{N}$, the following holds:

$$
a_{n}+a_{n+1}=a_{n+2} a_{n+3}-200
$$
## Solution.

By subtracting the equations

$$
\begin{aligned}
a_{n}+a_{n+1} & =a_{n+2} a_{n+3}-200 \\
a_{n+1}+a_{n+2} & =a_{n+3} a_{n+4}-200
\end{aligned}
$$

we get

$$
a_{n}-a_{n+2}=a_{n+3}\left(a_{n+2}-a_{n+4}\right)
$$

Since $a_{n+3}>0$, it follows that

$$
\begin{array}{lll}
a_{n}>a_{n+2} & \text { if and only if } & a_{n+2}>a_{n+4} \\
a_{n}=a_{n+2} & \text { if and only if } & a_{n+2}=a_{n+4} \\
a_{n}<a_{n+2} & \text { if and only if } & a_{n+2}<a_{n+4}
\end{array}
$$

1. If $a_{n}>a_{n+2}$, then $a_{n+2}>a_{n+4}>\ldots$ and there would have to be a term in the sequence less than 1. Contradiction.

Therefore, it must be:

$$
a_{n}=a_{n+2} \quad \text { for all odd } n \quad \text { or } \quad a_{n}<a_{n+2} \quad \text { for all odd } n
$$

If $a_{n}<a_{n+2}$, then $a_{n+2}<a_{n+4}<\ldots$ and there would have to be a term in the sequence greater than 1. Contradiction.

Thus, it must be:

$$
a_{n}=a_{n+2} \quad \text { for all odd } n
$$

2. $a_{n}=a$ for all odd $n$ and $a_{n}=b$ for all even $n$

From the given condition, we get the equation $a+b=a b-200$ which can be written in the form $(a-1)(b-1)=201=3 \cdot 67$. The solutions are $(a, b) \in\{(2,202),(202,2),(4,68),(68,4)\}$.
3. $a_{n}=a$ for all odd $n$ and $a_{n}<a_{n+2}$ for all even $n$

Then, according to $(*)$

$$
a_{4}-a_{2}=a\left(a_{6}-a_{4}\right)=a^{2}\left(a_{8}-a_{6}\right)=\ldots=a^{m-1}\left(a_{2 m+2}-a_{2 m}\right)=\ldots
$$

which is possible only if $a=1$.

Let $d=a_{4}-a_{2}$. Then $a_{2 m+2}-a_{2 m}=d$ for all $m \in \mathbb{N}$, so $a_{2 m}=$ $a_{2}+(m-1) d$. From the initial condition, we get that $d=201$.

For $b \in \mathbb{Z}$, the sequence $1, b, 1, b+201,1, b+402,1, \ldots$ satisfies the given condition.
4. $a_{n}<a_{n+2}$ for all odd $n$ and $a_{n}=b$ for all even $n$

Similarly to the previous case, we get the solution

$$
a, 1, a+201,1, a+402,1, \ldots \quad \text { where } a \in \mathbb{Z}
$$