It seems that it is a calculation of Fibonacci numbers. Operator % is used to determine the index of the next element.
You have three elements in the array. Their indexes are 0, 1 and 2. So for any given number n you can get an index in the range [0, 2] by applying operator %.