The cost of solve (and verify) is dominated byBigInt multiplications. At some size of modulus, an FFT-based multiplication (i.e.. Schönhage–Strassen) will be faster than the direct method, and also can potentially be parallelised (undermining the desired non-parallelisableness of the challenge).
It would be good to know what modulus this is.