Let be the sequence defined by for .
The first terms of are:
Consider the subsequences consisting of terms in ascending order. For the part of the sequence shown above, these are:
and
.
Define to be the sum of the terms for all such subsequences within the first terms of . Thus .
You are given that .
Find modulo .
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.