## Brainteaser 1724: Like a lamb

**From The Sunday Times, 1st October 1995** [link]

Mary had a little lamb,

Its fleece was white as snow

And everywhere that Mary went

The lamb was sure to go.It followed her to school one day,

But found the maths a bore,

For lambs, you see, do all their counting

On a scale of four.Thus when a lamb writes two times two

Its answer looks like 10,

While our 10 written by a lamb

Is double-2 again!It much distressed them both to find

They never could agree

On how to write down any

Of the numbers after three.At last they hit on some for which

The lamb would only need

Two figures placed in front of Mary’s,

Then they were agreed.Which two figures?

This puzzle was included in the book *Brainteasers* (2002, edited by Victor Bryant). The puzzle text above is taken from the book.

[teaser1724]

## Jim Randell 3:52 pm

on3 October 2019 Permalink |We are to infer from the puzzle text that the lamb counts using base 4, with the standard symbols 0, 1, 2, 3.

So we need to find numbers in base 4 whose representation in base 10 is the same as the representation in base 4 but with the leftmost 2 digits removed.

This Python program runs in 221ms.

Run:[ @repl.it ]Solution:The 2-digit prefix is 30.The only viable numbers are:

The program considers base 4 numbers that are 5-, 6- and 7-digits long, and looks for corresponding 3-, 4- and 5- digit base 10 numbers.

LikeLike