Given that in the 8-digit number A B C D E F G H ,
(i)
A
B
C
D
=
E
F
G
H
(ii) The numbers
A
B
C
D
E
F
G
H
and
A
B
C
D
0
E
F
G
H
are both divisible by
1
1
.
Let the sum of all possible values of
A
B
C
D
E
F
G
H
be
N
.
Find the digit sum of N .
Details and assumptions :-
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.
Nice solution, same way here: except I used a slightly different summation
1 0 0 0 1 0 ∑ 8 1 8 1 1 x + 1 0 0 1
@Aditya Raut as ,You said we could use python for this soo below is my python code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
can u tell me yours, Aditya
Log in to reply
You want a programming solution? Here's the one that takes less than 1 second for giving the answer.... @Mehul Chaturvedi you will surely like this.... I have first made the integers into strings, then I added strings which is way easier and faster for the computer, then I converted the strings back to integers for checking divisibility by 11, and finally made all of them append to a list, asking sum of that list...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Now easily get the sum of digits which is 36. Please read and contact if you don't understand something, this is way better than giving every letter all values and then checking loads of calculations you're gonna love this way...
I guess your program must have taken a lottttt time to give answer, also it is not bug free, it's not printed intended things
This is one inelegant way because the computer has to make lot calculations, for each letter 10 choices, then the * and + function, then == function.... Will post mine soon...
Log in to reply
No, @Aditya Raut It took just 1 minute
Log in to reply
@Mehul Chaturvedi – 1 minute is way out of efficiency for a program of this kind man, this problem must get solution in maximum 5 seconds...
First of all, let me give you one more way of getting sum of digits, it is a hint towards my programming solution for the problem:-
1 2 3 4 5 6 7 8 9 |
|
Log in to reply
@Aditya Raut I just know basic commands in Python ,therefore my solution was long....would you suggest me some source from where i can learn python,or from where did u learn. And please check the message on slack
Its easy for me to visualize the concept, but not the summation, so here's python brute force
for i in range( 1 0 0 0 , 1 0 0 0 0 ):
x = i ∗ 1 0 0 0 0 + i
i f ( ( x / 1 1 ) = = x / 1 1 . ) :
z+=x
print z
From(ii) it follows that the difference 9 0 0 0 0 × A B C D must also be divisible by 11. Because 90000 and 11 are coprime, A B C D itself must be divisible by 11.
Multiples of 11 that form 4-digit numbers are 9 1 × 1 1 = 1 0 0 1 , 9 2 × 1 1 , . . . through 9 0 9 × 1 1 = 9 9 9 9 .
The sum of all these is 1 1 × ( 9 1 + 9 2 + . . . + 9 0 9 ) = 1 1 × 2 ( 9 0 9 + 9 1 ) × ( 9 0 9 − 9 1 + 1 ) = 4 5 0 4 5 0 0 .
The sum of all A B C D A B C D then is 10001 times this, so 45049504500 of which the digit sum is 3 6 .
Note: I misread the question first, so I calculated N itself.
Problem Loading...
Note Loading...
Set Loading...
Because it's given that A B C D = E F G H , we have
A B C D E F G H = A B C D A B C D = 1 0 0 0 1 × A B C D .
Because 1 1 ∤ 1 0 0 0 1 , we obtain that 1 1 ∣ A B C D .
The A B C D 0 E F G H part is just a troll, because it will always be divisible by 11
A B C D 0 E F G H = A B C D 0 A B C D = A B C D × 1 0 0 0 0 1 and as 1 0 0 0 0 1 is divisible by 11, this is always divisible by 1 1 .
From this we conclude that A B C D is a 4-digit number divisible by 1 1 , that is ( 1 0 0 1 , 1 0 1 2 , . . . . , 9 9 9 9 )
Hence sum of all the values of A B C D E F G H is
1 0 0 0 1 × k = 9 1 ∑ 9 0 9 1 1 k = 1 0 0 0 1 × ( 8 1 9 × 2 1 0 0 1 + 9 9 9 9 ) = 1 0 0 0 1 × 4 5 0 4 5 0 0 = 4 5 0 4 9 5 0 4 5 0 0
Digit sum of 4 5 0 4 9 5 0 4 5 0 0 is 3 6