Do you expect me to sum 100 terms?

n = 1 100 102 101 ( 1 ) n n 2 = ? \sum _{ n=1 }^{ 100 }{ \left\lfloor { \frac { 102 }{ 101 } (-1)^{ n } }{ n }^{ 2 } \right\rfloor } =?


The answer is 5050.

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

Matt Janko
Jan 1, 2021

There is a nice generalization. For any positive odd integer a a , n = 1 a 1 ( 1 ) n n 2 = n = 1 a 1 a + 1 a ( 1 ) n n 2 = a ( a 1 ) 2 . \sum_{n = 1}^{a - 1} (-1)^n n^2 = \sum_{n = 1}^{a - 1} \left \lfloor \frac{a + 1}a (-1)^n n^2 \right \rfloor = \frac {a(a - 1)}2. To confirm the value of the first summation, notice that ( 2 k 1 ) 2 + ( 2 k ) 2 = 4 k 1 , -(2k - 1)^2 + (2k)^2 = 4k - 1, so we can reindex the first summation to obtain n = 1 a 1 ( 1 ) n n 2 = k = 1 ( a 1 ) / 2 ( 4 k 1 ) = 4 n = 1 ( a 1 ) / 2 k a 1 2 = 4 1 2 a 1 2 a + 1 2 a 1 2 = a ( a 1 ) 2 . \begin{aligned} \sum_{n = 1}^{a - 1} (-1)^n n^2 &= \sum_{k = 1}^{(a - 1)/2} (4k - 1) \\ &= 4 \sum_{n = 1}^{(a - 1)/2} k - \frac {a - 1}2 \\ &= 4 \cdot \frac 12 \cdot \frac {a - 1}2 \cdot \frac {a + 1}2 - \frac {a - 1}2 \\ &= \frac {a(a - 1)}2. \end{aligned} Next, for 1 n a 1 1 \leq n \leq a - 1 , write ( 1 ) n n 2 = q n a + r n (-1)^n n^2 = q_n a + r_n for integers q n q_n and r n r_n with 1 r n a 1 1 \leq r_n \leq a - 1 . The fractional part of a + 1 a ( 1 ) n n 2 \frac{a + 1}a (-1)^n n^2 is r n / a r_n/a , so n = 1 a 1 a + 1 a ( 1 ) n n 2 = a + 1 a n = 1 a 1 ( 1 ) n n 2 1 a n = 1 a 1 r n . \sum_{n = 1}^{a - 1} \left \lfloor \frac {a + 1}a (-1)^n n^2 \right \rfloor = \frac {a + 1} a \sum_{n = 1}^{a - 1} (-1)^n n^2 - \frac 1a \sum_{n = 1}^{a - 1} r_n. We have shown that the first summation on the right is equal to a ( a 1 ) / 2 a(a - 1)/2 . Notice that ± k 2 ( a k ) 2 0 ( m o d a ) \pm k^2 \mp (a - k)^2 \equiv 0 \pmod a and thus r k + r a k = a r_k + r_{a - k} = a . This means n = 1 a 1 r n = k = 1 ( a 1 ) / 2 ( r k + r a k ) = k = 1 ( a 1 ) / 2 a = a ( a 1 ) 2 . \sum_{n = 1}^{a - 1} r_n = \sum_{k = 1}^{(a - 1)/2} (r_k + r_{a - k}) = \sum_{k = 1}^{(a - 1)/2} a = \frac {a(a - 1)}2. Therefore, n = 1 a 1 a + 1 a ( 1 ) n n 2 = a + 1 a a ( a 1 ) 2 1 a a ( a 1 ) 2 = a ( a 1 ) 2 . \sum_{n = 1}^{a - 1} \left \lfloor \frac {a + 1}a (-1)^n n^2 \right \rfloor = \frac {a + 1}a \cdot \frac {a(a - 1)}2 - \frac 1a \cdot \frac {a(a - 1)}2 = \frac {a(a - 1)}2.

When a = 101 a = 101 , we obtain n = 1 100 102 101 ( 1 ) n n 2 = 101 100 2 = 5050 . \sum_{n = 1}^{100} \left \lfloor \frac {102}{101} (-1)^n n^2 \right \rfloor = \frac {101 \cdot 100}2 = \boxed{5050}.

Md Zuhair
Aug 19, 2017

To me, This was a Computer Science question. And i Wrote this code in c++

include<iostream>

using namespace std; int main() { int n,S,i=1,t1=1,t2,term;

cout<<"Enter how much to sum";

cin>>n;

for(i=1;i<=n;i++)
{

t1=t1*(-1);


t2=i*i;


term=102/101 * t2 * t1;

    S=term+S;
}

cout<<"The sum"<<S;

fflush(stdin);

getchar();

return 0;

}

I tried the problem more than once and each time got an answer of 5100, which Brilliant says is wrong. The (-1)^n makes for an alternating series is the squares; i.e. -1, +4, -9, etc. We convert this to a positive arithmetic series by combining 2 terms to form one as follows: -1 + 4 = +3; -9 + 16 = + 7; -25 + 26 = +11. In short, we create the series 3 + 7 + 11 + 15 + 19 + 23 + 27 + 31 +.............. + 195 + 199. this series has 50 terms, first term =3, last term = 199, so has a sum S = (n/2) (a + l) = (50/2)(3 + 199) = 25 202 = 5050. We multiply this by 102/101, which can be taken out of the summation sign, and the final sum is (102/101)*5050 = 5100. Ed Gray

Edwin Gray - 3 years, 9 months ago

Log in to reply

Yes sir. Correct.

So?

Md Zuhair - 3 years, 9 months ago

My apologies. I inserted a solution in the comments field. Ed Gray

Edwin Gray - 3 years, 9 months ago

Log in to reply

:). No apologies sir! Mistakes are what we all make. Well, Your solution is quite good! Keep it up.(+1)!

Md Zuhair - 3 years, 9 months ago

I see my error' I ignored the greatest integer function. Sorry if I wasted your time as well as mine. Ed Gray

Edwin Gray - 3 years, 9 months ago

Log in to reply

Noh! I learned something new from your solution. Very very thank you sir :)

Md Zuhair - 3 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...