## Teaser 3028: Rainbow numeration

**From The Sunday Times, 4th October 2020** [link]

Dai had seven standard dice, one in each colour of the rainbow (ROYGBIV). Throwing them simultaneously, flukily, each possible score (1 to 6) showed uppermost. Lining up the dice three ways, Dai made three different seven-digit numbers: the smallest possible, the largest possible, and the “rainbow” (ROYGBIV) value. He noticed that, comparing any two numbers, only the central digit was the same, and also that each number had just one single-digit prime factor (a different prime for each of the three numbers).

Hiding the dice from his sister Di’s view, he told her what he’d done and what he’d noticed, and asked her to guess the “rainbow” number digits in ROYGBIV order. Luckily guessing the red and orange dice scores correctly, she then calculated the others unambiguously.

What score was on the indigo die?

I’ve changed the wording of the puzzle slightly to make it clearer.

[teaser3028]

## Jim Randell 5:17 pm

on2 October 2020 Permalink |(Note: I’ve updated my program (and the puzzle text) in light of the comment by Frits below).

This Python program runs in 49ms.

Run:[ @repl.it ]Solution:The score on the indigo die is 4.Each of the digits 1-6 is used once, and there is an extra copy of one of them. So there is only one possible set of 7 digits used.

The smallest number is: 1234456 (divisible by 2).

And the largest number is: 6544321 (divisibly by 7).

There are 17 possible values for the “rainbow” number, but only 3 of them are uniquely identified by the first 2 digits: 2314645, 3124645, 3614245 (and each is divisible by 5).

The scores on the green, indigo and violet dice are the same for all three possible “rainbow” numbers: 4, 4, 5. So this gives us our answer.

LikeLike

## Frits 11:02 pm

on2 October 2020 Permalink |“each number had just one prime factor under 10 (different for each number)”.

The three numbers you report seem to have same prime factors under 10, maybe I have misunderstood.

LikeLike

## Jim Randell 11:10 pm

on2 October 2020 Permalink |@Frits: I think you could be right. I took it to mean that it wasn’t the same prime in each case (two of the numbers I originally found share a prime). But requiring there to be three different primes does also give a unique answer to the puzzle (different from my original solution). So it could well be the correct interpretation (and it would explain why we weren’t asked to give the rainbow number). Thanks.

LikeLike

## Frits 11:35 pm

on2 October 2020 Permalink |@Jim: I hope to publish my program tomorrow (for three different prime numbers). I don’t have a clean program yet.

Your solution also seems to be independent of the indigo question (it could have been asked for another colour). In my solution this specific colour is vital for the solution.

LikeLike

## Frits 11:26 am

on3 October 2020 Permalink |Next time I try to use the insert function (list).

LikeLike

## Frits 2:58 pm

on4 October 2020 Permalink |A more efficient program (without explaining the choices as this is a new puzzle).

LikeLike