Cutest problem I've ever seen. If anyone still doesn't understand, it basically comes down to removing "unique" products and sum from the possibility space.
That's an elegant way to do it. For a brief moment I considered solving this by hand using basically the same idea, but that gets incredibly painful before I even got started.
I mean, obviously the extremes get eliminated right away, and then the primes, but then I have to track 10,000 number combinations.
I originally also thought about doing this (sort of) by hand, but once you realize that the possibility space is too large, programming it really helps you see what kinda pairs you are actually eliminating.
You can actually WLOG away all pairs where the second element is larger than the first.
Also, the most common kind of pair I eliminated was actually due to the size constraint (ie, 98 * 99) or pairs of (1, prime) which I didn't actually realize would be a thing until I coded it up.
Here is some python code that might be more revealing https://www.online-python.com/c5nAfLoIqr
A code review would be greatly appreciated!