Jeffrey K. answered 08/17/20
Together, we build an iron base in mathematics and physics
Hi Jay, this is a clever logic problem with just a little math!
Let's look a bit more closely at what Bernard does. It seems confusing whether any particular number is in or out at the end.
If we consider FACTORS, it becomes clear.
Every number has one or more factors. For example, 15 = 3 x 5, so the factors of 15 are: 3, 5, and 15. Therefore, 15 goes OUT with the 3s, then IN again with the 5s, and finally OUT with the 15s. That means the driver of car #15 is OUT at the end.
Similarly, 27 = 3x 3 x 3 so the factors of 27 are: 3, 9, and 27 => 27 goes OUT with the 3s, then IN with the 9s, and finally OUT with the 27s. So, he driver of car #27 is OUT at the end.
But what about 9? Its factors are 3 and 9. So the driver of car # 9 goes OUT with the 3s and IN with the 9s, then stays IN until the end,
How about 25? Its factors are 5 and 25 so the driver of car # 25 goes OUT with the 5s and In with the 25s and then the driver stays IN until the end.
The difference is that 9 and 25 each has an EVEN number of factors! And the same is true for 1, 4, 9, 16, 25, 36, 49, 64, . . .
All of these are SQUARE numbers, that is 12, 22, 32, 42, 52, 62, . . . At the end, the drivers of these cars are IN and all the rest are OUT.
That's it!