## Fibonacci sequence modulo m

The Fibonacci sequence is an infinite sequence of integers $f_0,f_1,f_2,\dots$ defined by the initial values $f_0 = f_1 = 1$ and the rule $$f_{n+1} = f_n + f_{n-1}$$ In other words, to get the next term you take the sum of the two previous terms. For example, it starts off with: $$1,1,2,3,5,8,13,21,34,55,\dots$$ You can define […]