Frogs can be placed on the real number line at integer locations. Given coprime positive integers , each frog has the ability to make jumps of distances or in the positive direction.
Two frogs placed at and , , are attacking if the frog at can hop to with some series of jumps. For example if , frogs placed at and are attacking as the former can make two jumps of and one jump of to reach . However, frogs placed at and are non-attacking.
A non-attacking configuration is a placement of any number of frogs such that:
one frog is placed at ;
all other frogs are placed at distinct positive integers;
no two frogs are attacking.
Define to be sum of the integer locations of every frog, summing over all non-attacking configurations. For example if there are seven non-attacking configurations:
giving .
You are also given .
Find .
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.