The Impossible Problem

In 1969, Hans Freudenthal posed a puzzle that Martin Gardner would later call “The Impossible Problem”. Below is a 2000 version due to Erich Friedman.

I have secretly chosen two nonzero digits and have separately told their sum to Sam and their product to Pam, both of whom are honest and logical.

Pam says, “I don’t know the numbers”.
Sam says, “I don’t know the numbers”.
Pam says, “I don’t know the numbers”.
Sam says, “I don’t know the numbers”.
Pam says, “I don’t know the numbers”.
Sam says, “I don’t know the numbers”.
Pam says, “I don’t know the numbers”.
Sam says, “I don’t know the numbers”.
Pam says, “I know the numbers”.
Sam says, “I know the numbers”.

What are the numbers?

This beautiful problem may at first seem impossible, as you know neither the sum nor the product of the numbers, but the attached animation illustrates my solution.

Animated solution of “The Impossible Problem”. Matrix rows & columns are products and sums of nonzero digit pairs; filled squares indicate products & sums shared by pairs and not yet excluded by Pam or Sam