The following problem has been studied quite often (amongst others by Gardner, 1979):

Two numbers (not necessarily different) are chosen from the range of positive integers greater than 1 and not greater than 20. Only the sum of the two numbers is given to Mathematician S. Only the product of the two is given to Mathematician P.

On the telephone S says to P: “I see no way you can determine my sum.”

An hour later P calls him to say: “I know your sum.”

Later S calls P again to report: “Now I know your product.”

What are the two numbers?

This problem is known as the “Impossible Problem” because mathematician Martin Gardner (1914–2010) named it so in the article “A Pride of Problems, Including One That Is Virtually Impossible,” published in his column Mathematical Games in Scientific American magazine in 1979. The interesting thing is that the problem really is “impossible” because it has no solution! But this was not the intention. Gardner wrote about this fact some months later (Gardner, 1980). Gardner tried to simplify a problem originally proposed by the Dutch mathematician Hans Freudenthal (1905–1990) (Freudenthal, 1969). It was published in German, but was translated by Davis Sprows in 1976:

Let \( x \) and \( y \) be two numbers with \( 1 < x < y \) and \( x + y \le 100 \) Suppose S is given the value \( x + y \) and P is given the value \( xy \).

  1. (1)

    P says: “I don’t know the values of \( x \) and \( y \)”.

  2. (2)

    S replies: “I knew that you didn’t know the values.”

  3. (3)

    P responds: “Oh, then I do know the values of \( x \) and \( y \)”.

  4. (4)

    S exclaims: “Oh, then so do I.”

What are the values of \( x \) and \( y \)? (Sprows, 1976)

We call the above problem by Freudenthal’s Problem with sum equal to 100, represented by P100. The problem P100 is not impossible and has a unique solution!

We propose using the LISP language to approach these problems. For example, with the following code, we translate the Gardner’s Problem to LISP and prove that it has no solution:

  • (defun domain (x y) (<= 2 x y 20))

  • (defun sums (p)

    • (loop for n from 2 to (isqrt p) when (and (domain n (/p n)) (zerop (mod p n))) collect (+ n (/p n))))

  • (defun products (s)

    • (loop for n from 2 to (/s 2) when (domain n (- s n)) collect (* n (- s n))))

  • (defun revealing (p) (= 1 (length (somas p)))))

  • (loop for sum from 4 to 40 when (notany #’revealing (products sum)) collect sum)

Modifying the above code, it is possible to study problem P100 and discover its unique solution.