← Complete problem index

PROJECT EULER · #0992

Another Frog Jumping

Statement only · UnsolvedOriginal problem ↗

There are n+1 stones in a pond, numbered 0 to n.

A frog starts by jumping onto stone 0. It then jumps between the stones, only ever jumping to adjacent ones. For fixed k, it makes exactly k+i visits to each stone i for 0i<n; however, there are no restrictions on the number of times stone n is visited. The frog can finish on any stone.

If n=3 and k=2 it would visit stone 0 two times, stone 1 three times and stone 2 four times.
One way of achieving this is:
01012321232.

Let J(n,k) be the number of ways the frog can make such a journey. For example, J(3,2)=17, J(6,1)=1320 and J(6,5)=16793280.

Find s=04J(500,10s). Give your answer modulo 987898789.

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.