Does anyone know much about this Fibonacci-like sequence?

164 Views Asked by At

I recently came across this sequence which looks quite similar to the Fibonacci numbers.

Let $a_0 = 0 \ $ and $a_1 = 1$, then define $a_n := (a_{n-1} + a_{n-2}) \bmod n$. This is given by $A079777$ in the OEIS.

The first few terms are given below

$$a_2 = (1 + 0) \bmod 2 = 1$$ $$a_3 = (1 + 1) \bmod 3 = 2$$ $$a_4 = (2 + 1) \bmod 4 = 3$$ $$a_5 = (3 + 2) \bmod 5 = 0$$ $$a_6 = (0 + 3) \bmod 6 = 3$$ $$a_7 = (3 + 0) \bmod 7 = 3$$

This is essentially the Fibonacci sequence with an extra modulus operation, but the moduli change value each term, hence this is different from the sequence of Fibonacci numbers$\bmod N$.

Although I don't have any meaningful use of this sequence, I am curious to learn more about it. However, despite the sequence's simple definition and connection to the Fibonacci numbers, I'm yet to find much relevant information online.


One interesting thing I looked at is the indices $n$ such that $a_n = 0$, the first few being

$$0, \ 5, \ 9, \ 12, \ 24, \ 45, \ 60, \ 65, \ 179, \ ...$$

This is sequence $A073853$ in the OEIS, and its graph suggests that the terms grow exponentially. I managed to compute a new term in this sequence using some C code, and I believe that there are infinitely many.

Apart from the OEIS, I haven't found anything online regarding these two sequences as mentioned previously. I was a bit surprised at this considering their simplicity, so if anyone knows anything more about these sequences, or can provide links to other sources, I would greatly appreciate your help.