This is one of those questions that seems to be wide open for elaborate proofs - but it turns out the total number of possibilities isn't that large, and you can simply enumerate each one.
Heh, yup. I remember an article on here about some low-level calculation optimization for 32-bit ints that bugged out even with extensive edge-case testing. The conclusion being “just test all the numbers”, 2^32 isn’t that much!