EulerFermatTheorem LinearRecursion IMO Challenging

Problem - 2699

Let sequence $g(n)$ satisfy $g(1)=0, g(2)=1, g(n+2)=g(n+1)+g(n)+1$ where $n\ge 1$. Show that if $n$ is a prime greater than 5, then $n\mid g(n)[g(n)+1]$.


Let $f(n)=g(n)+1$, then $f(1)=1$, $f(2)=2$, and $f(n+2)=f(n+1)+f(n)$. The solution to this sequence is

$$\begin{align*} f(n)&=\frac{1}{\sqrt{5}}\cdot\left[\left(\frac{1+\sqrt{5}}{2}\right)^{n+1}-\left(\frac{1-\sqrt{5}}{2}\right)^{n+1}\right] \\ &=\frac{1}{2^n}\cdot\left(C_{n+1}^1 + 5C_{n+1}^3 + 5^2C_{n+1}^5+\cdots + 5^{\frac{n-1}{2}}C_{n+1}^n \right) \end{align*}$$

Because $n$ is a prime greater than $5$, therefore $(2, n)=1 \implies (2^n, n)=1$ and $n\mid C_{n+1}^i$ where $3 \le i \le n-1$. Therefore, the previous relation will lead to $$2^nf(n)\equiv C_{n+1}^1 +5^{\frac{n-1}{2}}C_{n+1}^n\equiv (n+1)\left(1+5^{\frac{n-1}{2}}\right)\pmod{n}$$

It follows that $$2^n[f(n)-1]\equiv 1+ 5^{\frac{n-1}{2}} - 2^n\equiv -1+ 5^{\frac{n-1}{2}}\pmod{n}$$

by Fermat Little Theorem. Multiplying the last two equations gives $$2^{2n}f(n)[f(n)-1]\equiv 5^{n-1} - 1 \equiv 0 \pmod{n}$$

by Fermat Little Theorem again. Therefore $$f(n)[f(n)-1]\equiv 0\pmod{5} \implies g(n)[g(n)+1]\equiv 0\pmod{5}$$

report an error