### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,158)
- misc (2)
- project euler (2)
- puzzle (40)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,972 hits

Advertisements

Programming Enigma Puzzles

26 March 2013

Posted by on **From New Scientist #2910, 30th March 2013** [link]

I have a seven-figure number that uses seven consecutive digits in some order. Starting at the left and deleting a digit leaves a six-digit number, then deleting the right-end digit leaves a five-digit number, then deleting the left-hand end digit leaves a four-digit number, and so on, alternating sides until a single digit is left. Looking at the list of seven numbers obtained in this way I see that they are all odd, and that only the six-digit number is divisible by 3 (but not 9). Surprisingly, if I had carried out the process starting by deleting the right-hand end digit and then the left, and so on down to a single digit, all the above facts would still be true.

What number did I start with?

[enigma1742]

Advertisements

%d bloggers like this:

This Python program uses properties of digital roots to narrow down the candidates. It runs in 41ms.

Solution:The starting number is 4625317.There is only one answer, in which the middle digit is 5,

and seven-digit number is divisible by 47.

I agree with the answer, but not with some of the intermediate numbers your program outputs. For instance, they are not all odd.

These must be as

The output :

Answer: 4625317

1 ) 4625317 625317 62531 2531 253 53 5

1 ) 4625317 462531 62531 6253 253 25 5

Here is my version

If the 7 figure number is abcdefg, then as Jim points out, d,e,f,g must be odd, so there are 4 odd digits and 3 even digits, giving two candidate sets for the digits: 1 to 7 and 3 to 9.

Suppose the set of digits is 1 to 7

1+..+7 = 1 mod 3 , 1+..+7 = 1 mod 9, so g=7 and a=4 to make the six digit numbers abcdef and bcdefg divisible by 3 and not 9

Suppose the set of digits is 3 to 9

3+..+9 = 0 mod 3 and 3+..+9 = 6 mod 9, so a and g have to be 3 and 9 to make abcdef and bcdefg divisible by 3 and not 9, but a has to be even, so 3 to 9 cannot be the set of digits.

so we have a=4 and g=7 giving us 4261357 , 4261537 , 4263157 , 4263517 , 4265137 , 4265317 , 4625137 , 4625317 , 4623157 , 4623517 , 4621357 and 4621537 out of which only one of them is applicable to the conditions given in the problem, thus giving us the answer.