### Random Post

### Recent Posts

### Recent Comments

Hugh Casement on Enigma 1070: Time to work | |

Jim Randell on Enigma 1070: Time to work | |

Jim Randell on Enigma 1070: Time to work | |

geoffrounce on Enigma 440: Three X | |

Jim Randell on Enigma 1588: As easy as 1… |

### Archives

### Categories

- article (11)
- enigma (1,157)
- misc (2)
- project euler (2)
- puzzle (39)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,568 hits

Advertisements

This Python 3 program runs in 52ms.

Solution:There were 36 people in the room.The people who chose a non-zero number are shown below. The remaining 32 people all chose 0.

There are actually two further solutions with 4 people in the room:

But we’ll be generous and suppose that the “and so on…” after person number 3 implies there are more than 4 people, which gives a unique solution. Although I think the puzzle could have made this clear.

For 49 people there are 7 possible numbers each person can choose from (0, 1, 2, 4, 8, 16, 32), so there are 42 people whose numbers don’t coincide with the choice numbers and must chose 0, hence there are at least 42 zeros. But this is more than the largest possible choice number. So there cannot be 49 people in the room.

For 64 people there are now 8 possible choice numbers (0, 1, 2, 4, 8, 16, 32, 64), so there must be at least 56 zeros, and the only choice number at least as large as this is 64. But there cannot be 64 zeros, as person number 0 would have to choose 64. So there cannot be 64 people in the room.

In fact by considering when:

or equivalently when the following equation is greater than zero:

we can see that there can be no solutions for greater than 64 people.

Of course, if you don’t trust the analysis, you can let the program consider squares up to 70710², at which point the number of people in the room would exceed 5×10

^{9}, which is greater than the number of people on the planet in 1982. This only takes 1.5s with the program above (or 168ms with an equivalent program running under PyPy).