There are stones in a pond, numbered to . Consecutive stones are spaced one unit apart.
A frog sits on stone . He wishes to visit each stone exactly once, stopping on stone . However, he can only jump from one stone to another if they are at most units apart. In other words, from stone , he can reach a stone if and is in the set .
Let be the number of ways he can do this. For example, , as shown below:
Other examples are and .
Let for .
Examples:
Find .
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.