快猫短视频

快猫短视频 puzzle #31: Three hats

#31 Three hats

Ariana, Beverley and Cassie are standing in a line. They know that two of them are wearing black hats and one is wearing a white hat 鈥 or vice versa 鈥 in an arrangement like the one shown above.

Beverley and Cassie can see the hats in front of them but not behind, while Ariana can鈥檛 see any hats. They can only say 鈥渨hite鈥 or 鈥渂lack鈥 to announce their own hat colour.

Who will be able to confidently state their hat鈥檚 colour first? And who will be second?

Answer next week

#30 Sticking in a PIN

Solution

We are looking for a four-digit PIN containing a zero that, when squared, ends in itself. This is known as an 鈥渁utomorphic鈥 number.

A quick mental calculation confirms that, of the numbers 0 to 9, only 0, 1, 5 and 6 end in themselves when squared, so our number must end with one of these. Moving on to two-digit numbers, you will find that only 00, 01, 25 and 76 end in themselves when squared.

There are algebraic ways of deducing the digits of longer numbers, but trial and error can be just as quick. Automorphic numbers ending with 0 or 1 always end with 0000 or 0001 when squared, which rules them out.

The only 鈥減roper鈥 four digit number that, when squared, ends in itself is 9376, which makes 87909376.

However, 9376 doesn鈥檛 contain a zero. Fortunately, PINs can have leading zeroes. The only number that has the required property is 0625 (its square is 390625), so this must be the answer.

Get in touch
Email us at puzzles@newscientist.com