I've found the seed by some educated guessing and brute force. But I'm wondering if there's an algorithm or a formula which will output the seed, I couldn't come up with anything given the dependency on the original seed and the mixing of logical and arithmetic operators. Maybe I'm missing something.