A few points, if I may:
All in all, this problem seems like a nice little assignment for a competent cryptanalyst.
Modulo cmps. Since (2**31)%1000003 == 477207, we know we may safely add small values to the hashval without fear of sign change or overflow. This allows one to rewrite tests such as
v %= 1001; if (v < 0) v += 1001; if (v != 100) continue;
in a simpler, speedier form:
v += 1001 - 100; if (v % 1001) continue;
(*) Updated.
In reply to Re: The 10**21 Problem (Part 3)
by oiskuu
in thread The 10**21 Problem (Part 3)
by eyepopslikeamosquito
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |