Number Theory

Math puzzles and brain teasers involving the properties of integers

The Impossible Puzzle

This puzzle was coined the “Impossible Puzzle” by Martin Gardner, a famous math and science writer that liked to create and write about math games and puzzles. The puzzle is named as such because it appears to provide insufficient information to solve, but it is in fact solvable! Read on for the puzzle and the (very difficult) solution.


There are two distinct whole numbers greater than 1, we can call them x and y (where y > x). We know the sum of x and y is no more than 100.

Sam and Prada are perfect logicians. Sam (“sum”) is told x + y and Prada (“product”) is told x * y, and both of them know all the information provided so far.

Sam and Prada have this conversation in which they truthfully deduce the numbers:

  1. Sam: I know Prada does not know x and y.
  2. Prada: Well now I know x and y.
  3. Sam: Ah, now I also know x and y.

Can you figure out x and y using this information?

View Solution

Same Number of Handshakes

In some cultures, it is typical for guests at an event to shake hands when they meet other guests (when there isn’t a pandemic). Some might be more social and shake hands with a lot of other guests, while others may be less social and shake hands with few or no other guests.

Can you prove that, regardless of the number of guests at the event, there must be at least two guests with the same number of handshakes at the event? In other words, can you prove that it is impossible for every guest to have shaken a different number of hands?

Assume guests can’t shake hands with themselves.

Continue reading “Same Number of Handshakes”

Polydivisible Number

A polydivisible number is a number for which the first n digits form a number evenly divisible by n for all n between 1 and the number of digits of that number.

In other words, the first 2 digits form a number divisible by 2, first 3 digits form a number divisible by 3, first 4 digits form a number divisible by 4, etc. for all of the digits of the number.

Can you arrange the digits 1-9 to form a 9-digit polydivisible number? Each digit 1-9 must be used exactly once.

Continue reading “Polydivisible Number”

Moving Battleship Puzzle

You are trying to hit a moving battleship, but you have no way of monitoring its position. However, you have the following information:

  • You know where the battleship started.
  • You know when the battleship started moving.
  • You know the battleship is only moving along a straight line.
  • You know the battleship moves a constant speed per hour, and that speed is an integer. But you do not know what that speed is.

Every hour, you can fire precisely once at any point on that line. Is there a strategy you can use that will guarantee you will hit the battleship in a finite amount of time?


Fun fact, this was an actual brainteaser given to me in the second round interview for a hedge fund internship back in 2011.

Preparing for a brain teaser interview? Check out our ultimate guide to brain teaser interviews.

Continue reading “Moving Battleship Puzzle”