Last three digits of a sum

Determine the last three digits of

n = 2 10 , 000 , 000 ( n 7 + n 5 ) . \sum_{n = 2}^{10,000,000}(n^{7} + n^{5}).

This problem is posed by Zi Song Y.


The answer is 998.

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.

14 solutions

Let n = 1 1000 ( n 7 + n 5 ) a ( m o d 1000 ) \sum_{n=1}^{1000} (n^7+n^5) \equiv a \pmod{1000} .

Since n i ( m o d 1000 ) n \equiv i \pmod{1000} for some i { 1 , 2 , 3 , , 1000 } i \in \{ 1,2,3, \ldots ,1000\} , then, n = 1001 2000 ( n 7 + n 5 ) a ( m o d 1000 ) \sum_{n=1001}^{2000} (n^7+n^5) \equiv a \pmod{1000} .

In the same way, n = 2001 3000 ( n 7 + n 5 ) a ( m o d 1000 ) \sum_{n=2001}^{3000} (n^7+n^5) \equiv a \pmod{1000} , and so on.

Therefore, n = 1 10 , 000 , 000 ( n 7 + n 5 ) ( 10000 ) a 0 ( m o d 1000 ) \sum_{n=1}^{10,000,000} (n^7+n^5) \equiv (10000)a \equiv 0 \pmod{1000}

In other words, 2 + n = 2 10 , 000 , 000 ( n 7 + n 5 ) 0 ( m o d 1000 ) 2+ \sum_{n=2}^{10,000,000} (n^7+n^5) \equiv 0 \pmod{1000} , or n = 2 10 , 000 , 000 ( n 7 + n 5 ) 998 ( m o d 1000 ) \sum_{n=2}^{10,000,000} (n^7+n^5) \equiv 998 \pmod{1000} .

That means the last three digits of n = 2 10 , 000 , 000 ( n 7 + n 5 ) \sum_{n=2}^{10,000,000} (n^7+n^5) is 998 998 .

Most correct solutions were variations of this one and the two intended solutions. The most common mistake was not providing enough details, for example no explanation for the formula for the sum.

Some users discovered that the last three digits of the sum do not change as n is increased by 20. However, this phenomenon is not easy to justify. It is not true for the sum of n 5 n^5 or n 7 n^7 separately, and is related to the formula for the sum.

Calvin Lin Staff - 7 years ago
Morgan Dang
May 20, 2014

To find the last three digits, we consider:

n = 2 10 , 000 , 000 ( n 7 + n 5 ) ( m o d 1 , 000 ) \displaystyle \sum_{n=2}^{10,000,000}(n^7+n^5)\pmod{1,000}

This is congruent to the sum of the last three digits of each summand, which, fortunately for us, repeat with a period of 1,000. This results from the fact that

( 1 , 000 + n ) 7 + ( 1 , 000 + n ) 5 n 7 + n 5 ( m o d 1 , 000 ) (1,000+n)^7+(1,000+n)^5\equiv n^7+n^5\pmod{1,000}

by the Binomial Theorem.
That means that the sum from n=0 to 10,000,000 is a multiple of 10,000, or:

n = 0 10 , 000 , 000 ( n 7 + n 5 ) \displaystyle \sum_{n=0}^{10,000,000}(n^7+n^5)

= n = 2 10 , 000 , 000 ( n 7 + n 5 ) + ( 0 7 + 0 5 ) + ( 1 7 + 1 5 ) =\displaystyle \sum_{n=2}^{10,000,000}(n^7+n^5)+(0^7+0^5)+(1^7+1^5)

0 ( m o d 1 , 000 ) \equiv 0 \pmod{1,000}

Basic arithmetic does the rest.

n = 2 10 , 000 , 000 ( n 7 + n 5 ) + 2 0 ( m o d 1 , 000 ) \displaystyle \sum_{n=2}^{10,000,000}(n^7+n^5)+2\equiv 0 \pmod{1,000}

n = 2 10 , 000 , 000 ( n 7 + n 5 ) 998 ( m o d 1 , 000 ) \displaystyle \sum_{n=2}^{10,000,000}(n^7+n^5)\equiv 998 \pmod{1,000}

And so our answer is 998 .

Sumit Goel
May 20, 2014

n = 2 10000000 \displaystyle \sum_{n=2}^{10000000} n 5 + n 7 n^5+n^7 = n = 1 10000000 \displaystyle \sum_{n=1}^{10000000} ( n 5 + n 7 ) (n^5+n^7) -2
let xyz be the last 3 digits of n = 1 1000 \displaystyle \sum_{n=1}^{1000} n 5 + n 7 n^5+n^7

then xyz will be the last three digits for summation from 1001 to 2000,2001 to 3000 and so on using binomial theorem. there are 10000 such summations so we get n = 1 10000000 \displaystyle \sum_{n=1}^{10000000} ( n 5 + n 7 ) (n^5+n^7) %1000=000 on subtracting 2 we get 998.

Daniel Morton
May 20, 2014

The question is equivalent to finding the value of the sum $\mod 1000$. For any given $n$ we see that $(1000-n)\mod 1000 = -n$ and thus $(1000-n)^7\mod 1000 = (-n)^7\mod 1000 = -n^7\mod 1000$ and $(1000-n)^5\mod 1000 = (-n)^5\mod 1000 = -n^5\mod 1000$. Thus [\sum^1000 {n=1}(n^7 +n^5) = \sum^500 {n=1}(n^7 +n^5 +(1000 - n)^7 + (1000 - n)^5) = \sum^500_{n=1} (n^7 +n^5 - n^7 - n^5) = 0\mod 1000$.

By basic properties of modular arithmetic we get $\sum^{2000} {n=1001}(n^7 +n^5) = 0\mod 1000$, $\sum^{3000} {n=2001}(n^7 +n ^5) = 0\mod 1000$ etc. Thus the original problem just becomes [\sum^{10000000} {n=2}(n^7+n^5) = \sum^{1000} {n=2}(n^7+n^5)\mod 1000 = \sum^{1000}_{n=1}(n^7 + n^5) - 2\mod 1000 = -2\mod 1000 = 998 \mod 1000.

The final answer is 998

Siam Habib
May 20, 2014

Since, n = 2 10 , 000 , 000 n 7 + n 5 = n = 1 10 , 000 , 000 ( n 7 + n 5 ) ( 1 7 + 1 5 ) \displaystyle \sum_{n=2}^{10,000,000}n^7+n^5=\displaystyle \sum_{n=1}^{10,000,000}(n^7+n^5)-(1^7+1^5) = n = 1 10 , 000 , 000 ( n 7 + n 5 ) 2 =\displaystyle \sum_{n=1}^{10,000,000}(n^7+n^5) -2

We can prove that 2 × n = 1 k ( n p ) 2\times\displaystyle \sum_{n=1}^{k}(n^p) is always divisible by k k if p p is an odd number.

Since, we can always write ( k c ) p (k-c)^p as k p + a 1 k p 1 + a 2 k p 2 + . . . . . c p k^p + a_1k^{p-1} + a_2k^{p-2}+.....-c^p where c c is an integer constant and a 1 , a 2 , . . . . . . . ϵ Z a_1,a_2,.......\epsilon Z . [We don't even have to know the values of a 1 , a 2 , . . . . . . . . . . a_1,a_2,.......... . I'm not saying that we can't, but we just don't need to.] We can write- k p + a 1 k p 1 + a 2 k p 2 + . . . . . + c p k^p + a_1k^{p-1} + a_2k^{p-2}+.....+c^p as g k + c p gk + c^p where g ϵ Z g \epsilon Z .

Now, we can write: n = 1 k ( n p ) = S = 1 p + 2 p + 3 p + . . . . . . . . . . . . + k p \displaystyle \sum_{n=1}^{k}(n^p) = S = 1^p + 2^p +3^p +............+ k^p But, S = k p + ( k 1 ) p + ( k 2 ) p + . . . + 1 p S = k^p+(k-1)^p+(k-2)^p+ ...+1^p = k p + g 1 k 1 p + g 2 k 2 p + . . . . . + g k 1 k ( k 1 ) p = k^p+ g_1k - 1^p + g_2k - 2^p+ .....+g_{k-1}k-(k-1)^p

If we add them both we get, 2 S = 2 k p + g 1 k + g 2 k + . . . + g k 1 k = k × m 2S = 2k^p +g_1k + g_2k +...+ g_{k-1}k = k \times m . Here m = 2 k p 1 + g 1 + g 2 + . . . . + g k 1 m = 2k^{p-1} + g_1 +g_2+....+g_{k-1} and m m is a integer.

So, 2 × n = 1 10 , 000 , 000 ( n 7 + n 5 ) 2\times\displaystyle \sum_{n=1}^{10,000,000}(n^7+n^5) can be expressed as 1 0 7 × l 10^7 \times l where l l is an integer. Since, 2 × n = 1 10 , 000 , 000 ( n 7 + n 5 ) = 1 0 7 × l 2\times\displaystyle \sum_{n=1}^{10,000,000}(n^7+n^5)\ = 10^7 \times l So, n = 1 10 , 000 , 000 ( n 7 + n 5 ) = 1 0 7 × l 2 = 5 l × 1 0 6 \displaystyle \sum_{n=1}^{10,000,000}(n^7+n^5)\ = \frac{10^7\times l}{2} = 5l \times 10^6

So, n = 2 10 , 000 , 000 n 7 + n 5 = n = 1 10 , 000 , 000 ( n 7 + n 5 ) ( 1 7 + 1 5 ) \displaystyle \sum_{n=2}^{10,000,000}n^7+n^5=\displaystyle \sum_{n=1}^{10,000,000}(n^7+n^5)-(1^7+1^5) = 5 l × 1 0 6 2 = 1 0 3 × 5000 l 2 = 5l \times 10^6 - 2 =10^3 \times 5000l -2 = 1 0 3 + 1 0 3 + 1 0 3 + . . . . . . + 1 0 3 2 =10^3 +10^3 +10^3 +......+10^3 -2 [ 5000 l 5000l times ] = 998 + 4999 l × 1 0 3 =998+4999l\times10^3 So, the last three digits of n = 2 10 , 000 , 000 ( n 7 + n 5 ) \displaystyle \sum_{n=2}^{10,000,000}(n^7+n^5) = n = 2 10 , 000 , 000 ( n 7 + n 5 ) m o d 1000 =\displaystyle \sum_{n=2}^{10,000,000}(n^7+n^5) mod 1000
= ( 998 + 4999 t × 1 0 3 ) m o d 1000 = 998 =(998+ 4999t\times10^3)mod 1000 = 998

Tahsin Saffat
May 20, 2014

First, we show that for an odd number, k > 1 k>1 , i = 1 1000 i k 0 ( m o d 1000 ) \sum_{i=1}^{1000} i^k \equiv 0 \pmod{1000} .

This is because i k + ( i ) k 0 ( m o d 1000 ) i^k+(-i)^k \equiv 0 \pmod{1000} and for k > 1 k>1 , 50 0 k 0 ( m o d 1000 ) 500^k \equiv 0 \pmod{1000} .

Now, using this fact, i = 1 10000000 ( i 5 + i 7 ) 0 ( m o d 1000 ) \sum_{i=1}^{10000000} (i^5+i^7) \equiv 0 \pmod{1000} . Hence, i = 2 10000000 ( i 5 + i 7 ) 2 998 ( m o d 1000 ) \sum_{i=2}^{10000000} (i^5+i^7) \equiv -2 \equiv 998 \pmod{1000} and the answer is 998 \boxed{998} .

"and for k > 1 k>1 , 50 0 k 0 ( m o d 1000 ) 500^k \equiv 0 \pmod{1000} ." Seems irrelevant

Calvin Lin Staff - 7 years ago
Derk Pik
May 20, 2014

The function f ( n ) = Σ j = 2 n u 7 + u 5 f(n) = \Sigma_{j=2}^{n} u^7 + u^5 can be written as f ( n ) = 1 8 ( n 4 + 2 n 3 + 2 n 2 + 4 ) ( n 2 + n + 2 ) ( n + 2 ) ( n 1 ) . f(n) = \frac18 (n^4 + 2 n^3 + 2n^2 + 4)(n^2 + n + 2)(n+2)(n-1). Then f ( 1 0 7 ) = 1 8 ( A 1 0 14 + 4 ) ( B 1 0 7 + 2 ) ( 1 0 7 + 2 ) ( 1 0 7 1 ) , f(10^7) = \frac18 (A \cdot 10^{14} + 4)(B \cdot 10^7 + 2)(10^7 + 2)(10^7 - 1), for integers A ans B. Continuing this way, for some integer K we obtain f ( 1 0 7 ) = 1 8 ( K 1 0 7 + 8 ) ( 1 0 7 + 2 ) ( 1 0 7 1 ) f(10^7) = \frac18 (K \cdot 10^7 + 8)(10^7 + 2)(10^7 - 1) = ( K 1 0 6 + 1 ) ( 1 0 7 + 2 ) ( 1 0 7 1 ) 2 m o d 1000. = (K \cdot 10^6 + 1)(10^7 + 2)(10^7 - 1) \equiv -2 \ \ \mod 1000. Thus we arrive at 998.

"The function f ( n ) = Σ j = 2 n u 7 + u 5 f(n) = \Sigma_{j=2}^{n} u^7 + u^5 can be written as f ( n ) = 1 8 ( n 4 + 2 n 3 + 2 n 2 + 4 ) ( n 2 + n + 2 ) ( n + 2 ) ( n 1 ) . f(n) = \frac18 (n^4 + 2 n^3 + 2n^2 + 4)(n^2 + n + 2)(n+2)(n-1). " An induction proof (or discrete integration proof) is implied but not written up.

Calvin Lin Staff - 7 years ago
Yang Ren
May 20, 2014

when n=20, the last 3 digits are 998 , and the next summation of 20 terms would go back to such value of last 3 digits, since 20 is a factor of 10,000,000, the summation of 10,000,000 terms could be traced=998.

"since 20 is a factor of 10,000,000, the summation of 10,000,000 terms could be traced=998." It is not obvious that the last three digits are periodic with period 20. It happened once, so what?

Calvin Lin Staff - 7 years ago
Anqi Li
May 20, 2014

The instinct is to develop a reccursive relation so that the terms will cancel and produce a formula that is easier to work with. I will break the question up into 2 parts and work with n^5 and n^7 separately although later it will be shown that they both satisfy the same relations.

Let us define: q(n) = q(n-1) + n^5 r(n) = r(n-1) + n^7

Solving for both the recurrence and summing them up, one obtains p(n)=n^4 * (n+1)^4 / 8. We realise that when n = 10^k, 1000 is always a factor since p(10^k)=1000 * (10^(4 * k - 3) * (10^k+1)^4 / 8).

Therefore, the last 3 digits of this is m000 - 1^7 - 1^5 (where m stands for the digits in front of the sum that we do not want) since the summation starts from 2^5 and 2^7. Therefore, the last 3 digits is 998.

Many details are missing. The formula is probably found for the sum from n=1.

Calvin Lin Staff - 7 years ago
Ian Mana
May 20, 2014

any number with the same last 3 digit number that is raise to an integer, has the same last three digit number, like when 2 7 2^7 has same last three digit as of 100 2 7 1002^7

the sum of the first 10 10 or { 1 , 2 , 3 10 } \{1,2,3 \ldots 10\} has 250 for the last three digits then the next 10 10 or { 11 , 12 , 13 20 } \{11,12,13 \ldots 20\} has 750 and and by doing this, it will make a pattern of { 250 , 750 , 250 } \{250,750,250 \ldots\}

by this pattern, the first 20 20 numbers has a sum of 1000 1000 or 000 000 as its last three digit number. by this manner, the n = 1 1 , 000 , 000 ( n 7 + n 5 ) \displaystyle \sum_{n=1}^{1,000,000 }(n^7 + n^5) has 000 000 as its last three digit.

the 000 000 last three digits is only from 1 1 to 1000 1000 , but in n = 2 10 , 000 , 000 ( n 7 + n 5 ) \displaystyle \sum_{n=2}^{10,000,000}(n^7+n^5) we started at 2 so we subtract 1 7 + 1 5 = 2 1^7 + 1^5 = 2 from the overall sum.

so 000 2 = 998 000 - 2 = 998 is the last three digit of n = 2 10 , 000 , 000 ( n 7 + n 5 ) \displaystyle \sum_{n=2}^{10,000,000}(n^7+n^5)

"and by doing this, it will make a pattern of ({250,750,250 \ldots}\" It is not clear that this pattern will continue.

Calvin Lin Staff - 7 years ago
Rindell Mabunga
May 20, 2014

Let's consider first the summmation of n^7+n^5 from 1 up to 1000000:

If n=1, 1^7+1^5= 1+1 =2

If n=2, 1^7+1^5+2^7+2^5= 2+160= 162

If n=3, 1^7+1^5+2^7+2^5+3^7+3^5= 2592

If n=4, 1^7+1^5+2^7+2^5+3^7+3^5+4^7+4^5= 20000 ...

Multiply all this values by 8, we will get 16, 1296, 20736, 160000, ... These values are equal to 2^4, 6^4, 12^4, 20^4, ... which are also equal to (1^4 x 2^4), (2^4 x 3^4), (3^4 x 4^4), (4^4 x 5^4), ... Therefore the summation of n^7+n^5 from 1 up to n is equal to 1/8 x (n^4) x (n+1)^4. Substitute 1000000 for n, the summation will be equal to 1/8 x (1000000)^4 x (1000001)^4.

To get the last three digits, we have to get the remainder when this expression is divided by 1000.

If 1000000 is 0(mod 1000), then (1000000)^4 is 0^4(mod 1000) or 0(mod 1000).

If 1000001 is 1(mod 1000), then (1000001)^4 is 1^4(mod 1000) or 1(mod 1000).

8 is obviously 8(mod 1000).

Therefore the remainder when 1/8 x (1000000)^4 x (1000001)^4 is divided by 1000 is (0 x 1)/4 or 0.

That is only the remainder of the summation of n^7+n^5 from 1 up to 1000000 when divided by 1000, but how about the remainder of the summation of n^7+n^5 from 2 up to 1000000 when divided by 1000?

It is simple. Simply subtract two from the result. That's because 1^7+1^5 is added to our result. Remember the result that we earlier get is from 1 up to 1000000 not 2 from 1000000.

Subtracting two from 0(mod 1000), the summation of n^7+n^5 from 2 up to 1000000 is -2(mod 1000) or simply 998(mod 1000).

This means that the last three digits of the summation of n^7+n^5 from 2 up to 1000000 is 998.

The induction argument is missing, the formula is just guessed. "Therefore the remainder when 1/8 x (1000000)^4 x (1000001)^4 is divided by 1000 is (0 x 1)/4 or 0." This is not how modular arithmetic works

Calvin Lin Staff - 7 years ago
Jorge Fernández
Jul 13, 2015

If the lower limit was 1 andwer would be 0. This is because the last three digits are the same no matter what full residue system mod 1000 you give. when taking the sum from 1 to 10,000,000 we have the sum for 10,000 residue systems. so it is 10,000 times a fixed integer. Hence answer is 0. so when we subtract 2 we get 998.

Jason Zou
Jun 30, 2015

n = 2 10 , 000 , 000 ( n 7 + n 5 ) = n = 1 10 , 000 , 000 ( n 7 + n 5 ) 2 \sum _{n=2} ^{10,000,000} (n^7+n^5)= \sum _{n=1} ^{10,000,000} (n^7+n^5) -2 .

So we will find n = 1 10 , 000 , 000 ( n 7 + n 5 ) m o d 1000 \sum _{n=1} ^{10,000,000} (n^7+n^5) \mod 1000 and subtract 2 from that.

Let f ( x ) = x 7 + x 5 f(x) = x^7 + x^5 . We can see that f ( x ) f(x) is odd, So f ( k ) + f ( k ) = 0 f(k)+f(-k)=0

Thus, we can pair the numbers, having f ( 1 ) + f ( 999 ) = f ( 2 ) + f ( 998 ) = = f ( 499 ) + f ( 501 ) = 0 f(1)+f(999)=f(2)+f(998)= \ldots = f(499)+f(501)=0 . It can easily be seen that f ( 500 ) = 0 f(500)=0 and f ( 1000 ) = 0 f(1000)=0 .

This can also be applied to the numbers from 1001 1001 to 2000 2000 , 2001 2001 to 3000 3000 , and so on.

So n = 1 10 , 000 , 000 ( n 7 + n 5 ) m o d 1000 \sum _{n=1} ^{10,000,000} (n^7+n^5) \mod 1000 is 0 0 and the desired sum is 998 \boxed{998}

Waldir F. Caro
May 20, 2014

To obtain the last three digits only need to sum the last three digits of each term (the remaining of the division of each term and 1000), since the modular operation is distributibe, and finally calculate the sum modulo 1000.

no proof given

Calvin Lin Staff - 7 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...