• A viral math riddle offers five clues to "unlock" a three-digit combination.
  • Like a riddle, this problem uses context clues and tricks to hide a fun solution.
  • The overall logic is similar to what you use if you complete sudoku puzzles.

This week, the math riddle below has spread on social media. Though we can't trace it back to an original source, whoever released it into the world knew exactly what they were doing, because the puzzle is delightfully devious and has stumped tons of people on Facebook and Twitter.

xView full post on X

But opening the lock isn’t impossible—it just takes some logic. So let’s solve the problem together.

The first clue reads, “682: One digit is right and in its place.” We can’t do anything with this clue yet.

The second clue reads, “614: One digit is right but in the wrong place.” This is already getting interesting, because now we can rule one number out.

The 6 is in the same place in both clues, and it couldn’t be “in its place” in one clue and “in the wrong place” in another.

Font, Text, Calligraphy, Line, Black-and-white, Artwork, Logo, Art,
Caroline Delbert

The third clue reads, “206: Two digits are right, but both are in the wrong place.” We’ve already ruled out 6, so our final number must have both a 2 and a 0, but in different places!

The fourth clue reads, “738: All digits are wrong.” Oh. Well, that means we can remove the 7, 3, and 8 values across the board.

Font, Text, Line, Calligraphy, Logo, Black-and-white, Artwork, Symbol, Art,
Caroline Delbert

Finally, the last clue reads, “380: One digit is right but in the wrong place.” Well, we’ve already eliminated the 3 and the 8. The 0 is right, but third place is the wrong place. In the third clue, we learned that second place is also the wrong place for 0. Our solution must begin with 0!

Now we have everything we need to find the whole answer. From the first clue, we now see the 2 is the correct digit that’s also in the right place. Our answer begins with 0 and ends with 2.

Our middle digit could be 1 or 4, right? But really, there’s only a single answer it can be. In our final answer, the only open spot is the middle spot. In clue 2, we learned that one digit was correct but in the wrong place, so we can’t copy the 1 from the middle spot in clue 2 into the middle spot in our final answer. It has to be 4.

That means the final lock combination is 042—that’s right, “the answer to the ultimate question of life, the universe, and everything,” as Douglas Adams imagined it.

Headshot of Caroline Delbert
Caroline Delbert

Caroline Delbert is a writer, avid reader, and contributing editor at Pop Mech. She's also an enthusiast of just about everything. Her favorite topics include nuclear energy, cosmology, math of everyday things, and the philosophy of it all.