### Brain Teasers

# Breaking Codes

You are a spy trying to gain access to a high profile building that contains very classified information. The only thing standing between you and those secrets is a keypunch security system containing the digits 1-9 that will open the door to the building. Your spy agency has provided you details about the order of the keys you need to enter:

1. Each digit is pressed once and only once.

2. No two consecutive digits are pressed consecutively.

3. The digits 2 and 4 are pressed 2nd and 4th in some order; the digits 6 and 8 are pressed 6th and 8th in some order.

4. The sum of the first 5 digits pressed is 19; the sum of the last 5 digits pressed is 27.

As you wonder why your agency couldn't just write down the sequence for you, you crack the code and enter the building.

What sequence of keys did you press on the security system to get into the building?

1. Each digit is pressed once and only once.

2. No two consecutive digits are pressed consecutively.

3. The digits 2 and 4 are pressed 2nd and 4th in some order; the digits 6 and 8 are pressed 6th and 8th in some order.

4. The sum of the first 5 digits pressed is 19; the sum of the last 5 digits pressed is 27.

As you wonder why your agency couldn't just write down the sequence for you, you crack the code and enter the building.

What sequence of keys did you press on the security system to get into the building?

### Hint

You can figure out the 5th digit to enter from clue 4 and some algebra.### Answer

5, 2, 7, 4, 1, 8, 3, 6, 9From clue 4, the sum of the first 4 digits to be pressed, the last 4 digits to be pressed, and two times the 5th digit to be pressed is 19 + 27 = 46. The sum of the first and last 4 digits to be pressed and the 5th digit must be the sum of the digits 1-9, from clue 1. This sum is 45, meaning the 5th digit is 46-45 = 1.

From clues 2 and 3, 2 must be the 2nd digit and 4 must be the 4th digit.

From clue 3, 7 must be the 1st or 3rd digit pressed since it can not be pressed before or after the 6 or 8. From clue 4, this means 5 must be pressed 1st or 3rd. But, from clue 2, it can not be the 3rd digit, so it must be the first, meaning 7 is the 3rd digit pressed.

That leaves 3, 6, 8, and 9 as the last 4 digits to be pressed. If 8 were pressed 8th, then the 9 must be pressed 6th, a contradiction with clue 4. So 8 must be pressed 6th meaning 9 is to be pressed last. This leaves 6 to be entered 8th and 3 to be entered 7th.

Hide Hint Show Hint Hide Answer Show Answer

## What Next?

View a Similar Brain Teaser...

If you become a registered user you can vote on this brain teaser, keep track of which ones you have seen, and even make your own.

### Solve a Puzzle

Comments hidden to avoid spoilers.

## Follow Braingle!