Squeeze your brain!

Find the 10-digit integer a b c d e f g h i j \overline{abcdefghij} containing all the numbers from 0 to 9 in such a manner that the first n n -digit number is divisible by n n .

For example: a b c d e f \overline{abcdef} has 6 digits so it needs to be divisible by 6.

Try more problems here .


The answer is 3816547290.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Sam Bealing
Jun 8, 2016

Here is an outline of a solution but in order to keep it reasonably brief I will leave some of the case checking to the reader:

10 a b c d e f g h i j 10 j j = 0 5 a b c d e 5 e e = 5 As e 0 10 \vert \overline{abcdefghij} \Rightarrow 10 \vert j \Rightarrow j=0 \\ 5 \vert \overline{abcde} \Rightarrow 5 \vert e \Rightarrow e=5 \quad \quad \color{#3D99F6}{\text{As } e \neq 0}

Note due to the divisibility by 2 , 4 , 6 , 8 2,4,6,8 we have that b , d , f , h b,d,f,h are all even so a , c , g , i a,c,g,i are all odd.

4 a b c d 4 c d 4 \vert \overline{abcd} \Rightarrow 4 \vert \overline{cd}

A bit of case checking shows d = 2 o r 6 d=2 \: or 6 as c c is odd.

6 a b c d 5 f and 3 a b c 3 d 5 f 6 \vert \overline{abcd5f} \: \text{and} \: 3 \vert \overline{abc} \Rightarrow 3 \vert \overline{d5f}

Checking cases for d , f d,f gives d = 2 , f = 8 o r d = 6 , f = 4 d=2,f=8 \: or \: d=6,f=4 .

Case 1: d = 2 , f = 8 d=2,f=8

8 a b c d 58 g h 8 8 g h 8 g h 8 \vert \overline{abcd58gh} \Rightarrow 8 \vert \overline{8gh} \Rightarrow 8 \vert \overline{gh}

As g g is odd and h h is even checking cases we get g = 1 , 5 , 9 g=1,5,9 and h = 6 h=6 using numbers we have already assigned to eliminate.

6 a b c 258 and 9 a b c 258 g 6 i 3 g 6 i 3 ( g + i ) 6 \vert \overline{abc258} \: \text{and} \: 9 \vert \overline{abc258g6i} \Rightarrow 3 \vert \overline{g6i} \Rightarrow 3 \vert (g+i)

Case checking again shows g = 9 , i = 3 g=9,i=3 is the only possible solution. We also have b = 4 b=4 as it is the only remaining even number.

7 a 4 c 2589 7 \vert \overline{a4c2589}

Checking the two combinations of 1 , 7 1,7 for a , c a,c we see this yields no solutions.

Case 2: d = 6 , f = 4 d=6,f=4

8 4 g h 8 g h 8 \vert \overline{4gh} \Rightarrow 8 \vert \overline{gh}

Checking cases gives h = 2 h=2 , g = 3 , 7 g=3,7 :

Case 2.1 g = 3 g=3

3 32 i i = 1 ( m o d 3 ) 3 \vert \overline{32i} \Rightarrow i=1 \pmod{3}

As i i is odd we have two solutions i = 1 , 7 i=1,7 checking the resulting combinations of a , c a,c for divisibility by 7 7 shows there are no solutions.

Case 2.2 g = 7 g=7

3 72 i i = 0 ( m o d 3 ) 3 \vert \overline{72i} \Rightarrow i=0 \pmod{3}

As i i is odd we get i = 3 , 9 i=3,9 checking resulting combinations of a , c a,c as above shows i = 9 , a = 3 , c = 1 i=9,a=3,c=1 is the only working triplet so our solution is:

3816547290 \color{#20A900}{\boxed{\boxed{3816547290}}}

Note: I have omitted a lot of case checking in this solution purely to try to keep it to a manageable size (it's already too long).

Moderator note:

Great approach! Clear presentation of the cases (esp the important parts).

fine mathematical(rather logical) approach.

Satyabrata Dash - 5 years ago

Did the same nice solution!

Aditya Kumar - 5 years ago

Python:

import itertools

def test(numstring):
    for i in range(0,10):
        if int(numstring[0:i+1:])%(i+1)!=0:
            return False
    return True

alist = [str(i) for i in range(0,10)]
a=list(itertools.permutations(alist))
for tuples in a:
    seed=""
    for a in tuples:
        seed+=a
    if seed[0]!="0" and test(seed):
        print (seed)

There were too many cases for my liking when I tried to abstain from using brute force, so I resorted to this python program.

I used a computer as well. Seemed as though there were too many case to check by hand. Nice problem though.

Sam Bealing - 5 years ago

Log in to reply

Thanks.. :)

Satyabrata Dash - 5 years ago

Log in to reply

Satyabrata Dash, Put your solution too.

Hritesh Mourya - 5 years ago

Log in to reply

@Hritesh Mourya I m waiting for some more to come up

Satyabrata Dash - 5 years ago

Log in to reply

@Satyabrata Dash OK, I will be waiting for your solution ........

Hritesh Mourya - 5 years ago

Log in to reply

@Hritesh Mourya Have a look at my solution above. It's pretty long and quite tedious so I'd be intrigued if there was a more efficient way to eliminate cases.

Sam Bealing - 5 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...