Voyage to Ithaca Writeup
Medusa’s Covenant
#1. INTENDED HIDDEN RULE
For an array a, count nonempty subsequences with selected indices i1 < i2 < ... < ik that satisfy every condition below:
- k is divisible by 3.
- Every consecutive index gap is odd and at most W.
- Comparisons between consecutive selected values repeat: <, >=, !=, <, >=, !=, ... The first comparison applies to the first selected pair.
Return the count modulo 1000000007. Positions distinguish subsequences, even when their values are equal. The empty subsequence is excluded.
Example: with [1, 2, 1] and W=3, the full sequence is valid: 1 < 2, 2 >= 1, both index gaps are 1, and the length is 3.
#2. DISCOVERY APPROACH
Compare short increasing, decreasing, and equal-valued tablets. Triples reveal the strict ascent followed by a non-strict descent. Longer samples are necessary to distinguish subsequent transitions and length conditions. Test hypotheses against ALL 56 tablets; matching a few is insufficient.
An organizer can enumerate comparison cycles of length 1 through 4 over {<, <=, >, >=, =, !=}, length moduli 2 through 5 and their residues, and both gap parities. Restrict gaps to W and enumerate short subsequences. Exactly one member of that bounded family matches the supplied tablets: the rule in section 1. Players are not told those search bounds.
Fairness caveat: the cryptic player statement does not mathematically identify a unique function among ALL possible functions. Finite examples cannot do that. Uniqueness was checked only within the bounded family above. Blind playtesting is needed to assess discoverability and timing. Twenty minutes is a design target, not a measured or guaranteed solve time.
#3. EFFICIENT ALGORITHM
Let dp[i][r] count valid partial subsequences ending at i whose length modulo 3 is r. A singleton contributes 1 to dp[i][1].
