What is the minimum modulus where the first $n$ values of Fibonacci sequence are still unique?

57 Views Asked by At

Using the sequence $F_1 = 1, F_2 = 2, F_n = F_{n-1} + F_{n-2}$

$$ 1, 2, 3, 5, 8, 13, \ldots $$

What is the smallest modulus $M$ for each $n$ such that this sequence $S_n = F_n \mod M$ has no duplicates?

E.g., for the first $3$ numbers, $1, 2, 3$, the smallest satisfying modulus is $3$, generating $1, 2, 0$. Anything smaller has non-unique values in the output, e.g. $2$ would make $1, 0, 1$.

This is my specific case, with the Fibonacci sequence, but because of it I also became interested in whether it's possible to calculate such $M$s for arbitrary sets of numbers. I didn't want to ask that in case of $XY$ problem and it turning out to be impossible for example, but it would be cool to hear a little about this problem too.

Many thanks!