## Teaser 2979: Mischievous Sam

**From The Sunday Times, 27th October 2019** [link]

I set Sam a question, the answer to which was a 3-digit number, with the digits increasing by 1 from first to last (e.g. 789)

Sam eventually produced a 3-digit answer, but only 2 of his digits were correct and in the correct position. The third digit was wrong.

Investigating further I found that Sam had the correct answer but, for devilment, decided to change it into a different (single-digit) base.

If I were to tell you which of his 3 digits was the wrong one, you should be able to tell me:

(a) the correct answer, and;

(b) the base used by Sam.What are they?

[teaser2979]

## Jim Randell 10:36 pm

on25 October 2019 Permalink |There are only 7 possible 3-digit decimal results, and each of these can only be expressed as a 3-digit number in a limited number of single digit integer bases, so the search space is very small.

The following Python program runs in 82ms.

Run:[ @repl.it ]Solution:(a) The correct answer is 123; (b) Sam used base 8.The only possible solutions are:

The first and third of these differ from the decimal representation in the first (most significant) digit. Which leaves the second (which differs in the second digit) as the solution.

If we allow bases higher than 9 we find there is one further potential candidate solution:

But this differs from the decimal representation in the first digit, so would not change the answer to the puzzle.

LikeLike

## GeoffR 7:54 pm

on28 October 2019 Permalink |I used a number base calculator to give an assisted manual solution.

Link: https://www.rapidtables.com/convert/number/base-converter.html?x=456&sel1=10&sel2=9

LikeLike

## GeoffR 11:34 am

on3 November 2019 Permalink |The first and third solutions both give the incorrect digit as the first position, so we cannot tell the incorrect digit from these two solutions.

The second solution gives a single position for the incorrect digit position, so this is the answer i.e Answer 123 (173 in base 8) differs in position 2.

LikeLike