The Fibonacci sequence is defined as follows: $F_0=0$, $F_1=1$, and $F_n=F_{n-1}+F_{n-2}$ for all integers $n\ge 2$. Find the smallest positive integer $m$ such that $F_m\equiv 0 \pmod {127}$ and $F_{m+1}\equiv 1\pmod {127}$.
I really came to know about a solution, which is tough for beginners, it uses Frobenius Endomorphisms, Fields, and quadratic reciprocity. I also came to know about this : $F_p=(\frac{p}{5})\mod{p}$ and $F_{p-(\frac{p}{5})}=0\mod{p}$. But i am afraid i cannot prove it. I am posting the tough answer below. But can someone also help in proving the above statement? I know modulo $5$, the only residues are $0,1,4$, but this is really tough. Please can you provide any elementary solution or nice hint?
The answer is $\boxed{256}$. By definition, $m$ is the period of $\{F_n\}$ mod $127$.
Let $\phi_1 = \dfrac{1+\sqrt{5}}{2}$ and $\phi_2 = 1-\phi_1$ be the solutions to $x^2-x-1=0$. Notice that since $\left( \dfrac{5}{127} \right) = \left( \dfrac{127}{5} \right) = -1$ by Quadratic Reciprocity that $\sqrt{5}\in \mathbb F_{127^2}, \sqrt{5}\not \in \mathbb F_{127} \implies \phi_1,\phi_2\in \mathbb F_{127^2}, \phi_1,\phi_2 \not \in \mathbb F_{127}$.
Now that we have $\left( \phi_1^{127} \right)^2 - \left( \phi_1^{127} \right) -1 = \left( \phi_1^2 - \phi -1 \right)^{127} = 0$ in $\mathbb F_{127^2}$ by the Frobenius Endomorphism. Then it follows that $\phi_1^{127}$ is a root of $x^2-x-1=0$, so $\phi_1^{127} \in \{ \phi_1, \phi_2 \}$.
But if $\phi_1^{127} = \phi_1$ then $\phi_1 \in \mathbb F_{127}$, a contradiction, hence $\phi_1^{127} = \phi_2$, so $\phi_1\phi_2=-1$ yields $\phi_1^{128}=-1 \implies \phi_1^{256}=1$, and similarly $\phi_2^{256}=1$.
By Binet's formula we have $F_m = \dfrac{1}{\sqrt{5}} \left( \phi_1^m - \phi_2^m\right)$. So now we know $F_{m+256} = \dfrac{1}{\sqrt{5}} \left( \phi_1^{m+256} - \phi_2^{m+256} \right) = \dfrac{1}{\sqrt{5}} \left( \phi_1^m - \phi_2^m \right) = F_m$ in $\mathbb F_{127^2}$, so by periodicity we know $m|256$.
But a similar computation yields $F_{m+128} = -F_m$ in $\mathbb F_{127^2}$, so $m\not | 128$, hence $m=256$.