This problem involves an iterative procedure that begins with a circle of integers. At each step every number is simultaneously replaced with the absolute difference of its two neighbours.
For any initial values, the procedure eventually becomes periodic.
Let be the sum of all possible periods for . For example, , because the possible periods for are . Specifically, and can each have period only, while can have period or , and can have period or .
You are also given .
Find .
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.