The sequence is defined by the recurrence relation
For fixed integers , it turns out that regardless of the initial values , the sequence is eventually periodic. Find the sum of all possible periods.
This problem is posed by C L.
Details and assumptions
As an explicit example, is a possible period since the recurrence relation is eventually periodic regardless of the starting values .