dva_mudretca

This is a scala lazy streams solution for a task:

Two integers, A and B, each between 2 and 100 inclusive, have been chosen.
The product, A×B, is given to mathematician Dr. P. The sum, A+B, is given to mathematician Dr. S. They each know the range of numbers. Their conversation is as follows:

P: "I don't have the foggiest idea what your sum is, S."
S: "That's no news to me, P. I already knew that you didn't know. I don't know either."
P: "Aha, NOW I know what your sum must be, S!"
S: "And likewise P, I have figured out your product!!"

What are the numbers?.

Explanation is here: https://geektimes.ru/post/249098/ (russian)