It all started when I was sitting on a bus-stop waiting next to an old man. I was listening to music through my headphones when a loud *BLING* interrupted the song I was running. It was a message from my friend who is a physics freshman and at times works at a convenient store in which he goes through magazines. In one of those magazines there was this riddle that gave you so few clues it almost seamed impossible. He told me:

“We should solve it together! If you solve it and submit the solution to the magazine’s email address you get a book of your choice! It goes like so:



Little Jimmy has integers a and b. a + b a + b to mister mathematician Y. Then the following conversation happens:

X: I don’t know your sum(a + b).

Y: No shit, I already knew that.

X: Now I know your sum(a + b).

Y: And so, I now know your product (a * b).

What is a and b?

At this point I’m at the bus and I’m scribling to S-note the following:

a, b > 1∈ Z

a + b X: a * b

Y: a + b

Fast forward, I’m off the bus. My special friend is late and so I have time to fill in:





a, b





(a * b)max = 2450 = 49 * 50

Fast forward again ->The night is over. I fell asleep having blissfully forgotten about the riddle. I wake up. Immediately sat on my desktop PC, grabbed a notebook and started thinking. As the sunrays were piercing my eyes, I scribbled on my notepad’s last page:

“When would X have an idea about the sum? If in our set of all possible products (all a * bs) from all the possible combinations of the multiplication of a and b X’s product is UNIQUE. That is Product P has only one a and only one b that can make it. That is because if P is UNIQUE, X can immediately find a and b, hence X would figure out the sum of a and b”









-ALARM CLOCKS KILL DREAMS-

THE 333 RULE

So P has to be UNIQUE. An easy to learn example of the above rule is the number 333 as a product. In all our Products 333 is only produced by a = 37

multiplied by b = 9 (also by a = 9 and b = 37 but we do not include the computative property). So X would immediately know a and b and he wouldnt tell Y he didnt know the sum, because he could just add 37 and 9 and find it!



So what we need to do is exclude all those UNIQUE numbers like 333. This I did with Microsoft Excel (you can do it with python if you want to make your life easy).

To cope with the amazingly big amount of combinations of a and b operations

(either a*b or a + b), I created a matrix. So in the x-axis exist: 2, 3, 4 … 96, 97

and in the y-axis exist: 2, 3, 4, ….96, 97. And we can create with this command: =$A2*B$1 the matrix of all products ( a * b ). So we come up with this rectangle!!!!:

Shit load of numbers!? I know right?

So in order to apply the a + b

Cut needs to start here:

Because as I said before we exclude the computative property and in order to satisfy Excel’s “Find all duplicate values and highlight them” command we need to make another cut in our matrix. That is because UNIQUE values in our matrix aren’t really UNIQUE yet because of the computative property( 2 x 3 = 6 exists but also 3 x 2 = 6 does too). So now we end up with this pretty isosceles triangle:





Now all UNIQUE values are truely UNIQUE in the sheet, and we can use this command:

And now we end up with this:

All white cells in this matrix are products that are UNIQUE and are excluded from the possible products X can have. Still a shit-ton of products huh?! I know right?!

-END THOUGHT CRIME; STOP THINKING-

At the cafeteria

Me and my physics student friend decide to meet at the cafeteria to cross our thoughts on the problem. It turns out he hasn’t been putting thought and/or progress into the riddle at all because he has been studying chemistry for the past few days (hence the scribbles on the paper: remains of me trying to explain to him electron configuration).

We met at 23:00 in the night in a cafeteria where no-one else was sitting at. Out of my backpack I pull out my papers and explain to him my process. My friend is a smart man as he sees my papers and listens to my words carefully and in deep thought he goes to say:”You sh-”. I interrupt him by saying “I’ve already have” as I pulled out another paper from my backpack showing him this matrix:

I explain to him that this is the equivelant matrix as the one before but this one is with the sums( a + b matrix). I pointed with my finger and told him: “As you can see the same sums come in diagonal lines starting from bottom left ending to top right” as you can see in this picture:

*Examples of the sum diagonals*

This sheet explains that those diagonals in the product table represent sets of products that have a common thing: The combinations of a and bs that produce them have the same sum!!!



Going back at the riddle mathematician Y in the second sentence of the conversation says that he already knew just by looking at his sum that there is NO WAY X can know the sum. So what we need to do to remove more products and solve the riddle is isolate the diagonals that have 0 UNIQUE products in the products sheet. Yes this is done manually and makes you hate your life… ESPECIALLY WHEN YOUR BUDDY IS BUSY STUDYING CHEM.



So at this point I’m channeling the power of good ol’ dirty bastard J and his crazy python skillz so that I automate the manual labor of finding fully yellow diagonal lines in my giant isosceles triangle of products. But the mathematical term language barrier is big and I end up doing a surprisingly bad job at explaining to him the process so that he types it in python in order to save me time and from getting a brain aneurism. So I decide to carry the team to victory and I start #YOLOmoding. What I end up is those groups of products:



*Ignore the colours. We’ll get to that later*

So now I have actually found all the diagonal lines that have 0 UNIQUE products( a * bs) in each of them. Or else I have found the FULLY DUPLICATE DIAGONAL LINES.

- I say ya kill your heroes and

Fly, fly, baby don’t cry.

No need to worry cause

Everybody will die.-

But how do we go from this to the solution?

The answer lies in the 3rd and 4th sentence of X and Y’s conversation.

X says that he knows the sum just by knowing Y already knew X wouldn’t know the sum from the start. That means his product that exists multiple times in this sheet exists only one time on a specific diagonal line.

To find all products that share this trait we can group and erase with a yellow highlight all numbers that exist on different diagonal lines. For example we see that 30 is in the first and second diagonal line we check them together with alt-clicks and paint them yellow ( they were already red). What we end up with is red products that one of them is the answer because they only exist in one diagonal line.

In the 4th sentence Y says that he now knows his product. The only way he could be knowing that is if in his diagonal line (that represents each sum ) there was only one red product.

This diagonal line is the second and it represents the sum=17. Let’s take a closer look at diagonal #2. :

THE END RESULT

As we can see the product is 52: and it gets produced by the multiplication of the numbers a = 13 and b = 4.

As the result was starting to form via the magic of those boxes and values and colours my heart started racing. As the number 52 showed up I jumped from joy and immediately e-mailed the magazine e-mail adress with the solution. With immense alacrity I told J and V and my physics freshman friend about the solution and couldn’t fall asleep that day from the rush of the excitement.



Thank you to J and V for telling me to do a write-up. Thank you for reading. Start solving your own riddle whatever it is in life, if it’s not life itself.

*Cool observation: Most UNIQUE products get generated by the multiplication of a and b PRIME numbers (hence the white lines)”