n = 1 ∑ 9 ( 1 1 × n ) 1 1 × n
Find the last three digits of the above summation.
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.
This is a good solution
Python 2.7:
1 2 |
|
How to write this type of Computerised Solution? I mean how to write the code in this form? @Brock Brown
Log in to reply
Do you mean the part that's like this?
1 |
|
That's called a list comprehension .
Here's an example of a list comprehension that finds the sum of the squares of the first 10 natural numbers:
1 |
|
Which is just the shorter version of this:
1 2 3 4 |
|
Does that answer your question, or were you asking something else?
Log in to reply
I was able to write the code.But I could not Write it in that form(program format) I want to post a solution as a code..
Log in to reply
@Anik Mandal – Oh, this will teach you how to use code blocks.
Problem Loading...
Note Loading...
Set Loading...
Let's write all items of the summation:
1 1 1 1 = ( 1 0 + 1 ) 1 1 = 1 0 0 0 × C 1 + ( 2 1 1 ) × 1 0 0 × 1 1 1 + 1 1 1 × 1 1 1 2 2 2 2 = ( 2 0 + 2 ) 2 2 = 1 0 0 0 × C 2 + ( 2 2 2 ) × 1 0 0 × 2 2 2 + 2 2 1 × 2 2 2 3 3 3 3 = ( 3 0 + 3 ) 3 3 = 1 0 0 0 × C 3 + ( 2 3 3 ) × 1 0 0 × 3 3 3 + 3 3 1 × 3 3 3 ⋮ 9 9 9 9 = ( 9 0 + 9 ) 9 9 = 1 0 0 0 × C 9 + ( 2 9 9 ) × 1 0 0 × 9 9 9 + 9 9 1 × 9 9 9
It's clear that 1 0 0 0 × C 1 , 1 0 0 0 × C 2 , 1 0 0 0 × C 3 , … , 1 0 0 0 × C 9 are divisible by 1 0 0 0 , so we just need to find the reminder of all two last items ( m o d 1 0 0 0 ) .
Now, we have
( 2 1 1 ) × 1 0 0 × 1 1 1 + 1 1 1 × 1 1 1 ≡ ( 5 0 0 + 1 1 1 ) × 1 1 1 ≡ 6 1 1 × 1 1 1 ( m o d 1 0 0 0 ) ( 2 2 2 ) × 1 0 0 × 2 2 2 + 2 2 1 × 2 2 2 ≡ ( 1 0 0 + 2 2 1 ) × 2 2 2 ≡ 3 2 1 × 2 2 2 ( m o d 1 0 0 0 ) ( 2 3 3 ) × 1 0 0 × 3 3 3 + 3 3 1 × 3 3 3 ≡ ( 8 0 0 + 3 3 1 ) × 3 3 3 ≡ 1 3 1 × 3 3 3 ( m o d 1 0 0 0 ) ⋮ ( 2 9 9 ) × 1 0 0 × 9 9 9 + 9 9 1 × 9 9 9 ≡ ( 1 0 0 + 9 9 1 ) × 9 9 9 ≡ 9 1 × 9 9 9 ( m o d 1 0 0 0 )
By using Euler's theorem, CRT, and the properties of modular arithmetic we will find that
2 2 2 ≡ 3 0 4 ( m o d 1 0 0 0 ) 3 3 3 ≡ 5 2 3 ( m o d 1 0 0 0 ) 4 4 4 ≡ 5 6 ( m o d 1 0 0 0 ) 5 5 5 ≡ 1 2 5 ( m o d 1 0 0 0 ) 6 6 6 ≡ 4 5 6 ( m o d 1 0 0 0 ) 7 7 7 ≡ 2 0 7 ( m o d 1 0 0 0 ) 8 8 8 ≡ 6 1 6 ( m o d 1 0 0 0 ) 9 9 9 ≡ 8 8 9 ( m o d 1 0 0 0 )
Then, we have left
6 1 1 × 1 + 3 2 1 × 3 0 4 + 1 3 1 × 5 2 3 + 4 1 × 5 6 + 5 1 × 1 2 5 + 1 6 1 × 4 5 6 + 3 7 1 × 2 0 7 + 6 8 1 × 6 1 6 + 9 1 × 8 8 9 ≡ 6 1 1 + 5 8 4 + 5 1 3 + 2 9 6 + 3 7 5 + 4 1 6 + 7 9 7 + 4 9 6 + 8 9 9 ≡ 4 9 8 7 ≡ 9 8 7 ( m o d 1 0 0 0 )