Alternating Sum Of Squares

Algebra Level 2

What is the value of ( 4 0 2 + 3 8 2 + + 4 2 + 2 2 ) ( 3 9 2 + 3 7 2 + + 3 2 + 1 2 ) (40^2 + 38^2 + \ldots + 4^2 + 2^2) - (39^2 + 37^2 + \ldots + 3^2 + 1^2) ?


The answer is 820.

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

We can group the given expression into:

( 4 0 2 3 9 2 ) + ( 3 8 2 3 7 2 ) + . . . + ( 2 2 1 2 ) (40^2 - 39^2) + (38^2 - 37^2) + ... + (2^2 - 1^2) , and with the use of the identity a 2 b 2 = ( a + b ) ( a b ) a^2 - b^2 = (a+b)(a-b)

= ( 4 0 2 3 9 2 ) + ( 3 8 2 3 7 2 ) + . . . + ( 2 2 1 2 ) = (40^2 - 39^2) + (38^2 - 37^2) + ... + (2^2 - 1^2) = ( 40 + 39 ) ( 40 39 ) + ( 38 + 37 ) ( 38 37 ) + . . . + ( 2 + 1 ) ( 2 1 ) = (40+39)(40-39) + (38+37)(38-37) + ... + (2+1)(2-1) = ( 40 + 39 ) ( 1 ) + ( 38 + 37 ) ( 1 ) + . . . + ( 2 + 1 ) ( 1 ) = (40+39)(1) + (38+37)(1) + ... + (2+1)(1) = ( 40 + 39 + 38 + 37 + . . . + 2 + 1 ) = ( 40 ) ( 41 ) / 2 = 820 = (40 + 39 + 38 + 37 + ... + 2 + 1) = (40)(41)/2 = 820

Answer: 820 820

I just used a computer but this solution is much more elegant.

Nicely done.

Leonhard Euler - 7 years, 9 months ago

thanxx

Raju Ahmmer - 7 years, 9 months ago

How did you reach this expression: (40)(41)/2 ?

Haya Khattak - 7 years, 9 months ago

Log in to reply

Using gauss therom, you add up 40+39+38+...+3+2+1, which will give you (40+1)*(40-0)/2

gerry zhang - 7 years, 9 months ago

The expression was taken from the formula for the sum of the first n integers of a sequence (n(n+1))/2

Hero Miles - 7 years, 9 months ago

u can also use Sn = n/2(2a + (n-1)d) n=nos.of series a=first nos d=diff. if u use this expression for 1+2+3+4....n u will get n(n+1)/2

Neeraj Sethi - 7 years, 9 months ago

nice im not sapereating so i not do nice

Manoj Kumar - 7 years, 9 months ago

nice!!!!!!very good explanation i wish like you. hehehhe galng brad!!! :)

Willvin Valois - 7 years, 9 months ago

n(n+1)/2 use only arithmetic progression

Kim Joshua Desposado - 7 years, 9 months ago

I made C code to solve it :P , but n!ce solution

Anas Mourad - 7 years, 9 months ago
Drew Cummins
Aug 25, 2013

If we look at the differences on a pairwise basis, we can can rewrite the problem as n = 1 20 ( 2 n ) 2 ( 2 n 1 ) 2 \sum_{n=1}^{20} (2n)^2 - (2n - 1)^2 or as the recurrence: f ( 0 ) = 0 f ( n ) = f ( n 1 ) + ( 2 n ) 2 ( 2 n 1 ) 2 , 1 n 20 \begin{aligned} f(0) &= 0 \\ f(n) &= f(n-1) + (2n)^2 - (2n - 1)^2, \; 1 \leq n \leq 20 \end{aligned} Expanding the first term in the pairwise difference simplifies the recurrence relation: f ( n ) = f ( n 1 ) + ( 2 n ) 2 ( 2 n 1 ) 2 = f ( n 1 ) + 4 n 2 4 n 2 + 4 n 1 = f ( n 1 ) + 4 n 1 \begin{aligned} f(n) &= f(n-1) + (2n)^2 - (2n - 1)^2 \\ &= f(n-1) + 4n^2 - 4n^2 + 4n - 1 \\ &= f(n-1) + 4n - 1 \end{aligned} When a recurrence relation is of the form f ( n 1 ) + g ( n ) f(n-1) + g(n) where g ( n ) g(n) is a polynomial in n n , we can write a generic function of one degree higher than g g to find a closed form solution to f f : f ( n ) = A n 2 + B n + C f(n) = An^2 + Bn + C Since we have 3 unknowns, we need 3 equations. Choosing n = 1 , 2 , 3 n=1,\,2,\,3 , we have: A + B + C = 3 4 A + 2 B + C = 10 9 A + 3 B + C = 21 \begin{aligned} A + B + C &= 3 \\ 4A + 2B + C &= 10 \\ 9A + 3B + C &= 21 \end{aligned} Solving this system reveals A = 2 , B = 1 A=2, \, B=1 and C = 0 C=0 , which gives the closed form solution: f ( n ) = 2 n 2 + n f(n) = 2n^2 + n Evaluating for n = 20 n=20 we find that f ( 20 ) = 2 × 400 + 20 = 820 f(20) = 2 \times 400 + 20 = 820 .

Moderator note:

Nice writeup on how to deal with a more general problem!

Wait I didn't know we could use math

Phil Machalski - 7 years, 9 months ago

Log in to reply

Lol Then what u thougt to $solve? :p

Pirah Sikandar - 7 years, 1 month ago
Chengfang Goh
Aug 28, 2013

Sum of squares of first n natural numbers = [ n (n+1) (2n+1) ] / 6

Sum of squares of first n odd natural numbers = [ n (2n-1) (2n+1) ] / 3

(refer Proof at http://www.9math.com/book/sum-squares-first-n-odd-natural-numbers)

The expression in the question equals to

( Sum of squares of first 40 natural numbers - Sum of squares of first 20 odd natural numbers) - Sum of squares of first 20 odd natural numbers

= Sum of squares of first 40 natural numbers - 2 x Sum of squares of first 20 odd natural numbers

= [ 40 (40+1) (2x40+1) ] / 6 - 2 [ 20 (2x20-1) (2x20+1) ] / 3

= 820

Moderator note:

Most people know the sum of squares of first n n positive integers. Do you also know the sum of squares of first n n odd positive integers?

How can you derive it?

I also used the same idea to solve it(but i did it without reading your solution!!!).

Kou$htav Chakrabarty - 7 years, 9 months ago

( 4 0 2 3 9 2 ) + ( 3 8 2 3 7 2 ) + . . . + ( 2 2 1 2 ) (40^2-39^2)+(38^2-37^2)+...+(2^2-1^2)

= ( 40 + 39 ) + ( 38 + 37 ) + . . . + ( 2 + 1 ) =(40+39)+(38+37)+...+(2+1)

= 3 + 7 + . . . + 79 =3+7+...+79

= 20 2 × ( 3 + 79 ) =\frac{20}{2}\times(3+79) ; [ 3 + ( n 1 ) 4 = 79 n = 20 ] [3+(n-1)4=79\Leftrightarrow n=20]

= 820 =820

Christopher Holt
Aug 28, 2013

(2..40).step(2).to a.collect{|i| i*i}.inject(:+)-(1..39).step(2).to a.collect{|i| i*i}.inject(:+)

(1..20).to_a.map{|x| (2*x)**2-(2*x-1)**2}.reduce(:+)

Drew Cummins - 7 years, 9 months ago
Jebu Sultana
Aug 28, 2013

Let's rewrite...

( 4 0 2 + 3 8 2 + . . . + 4 2 + 2 2 ) ( 3 9 2 + 3 7 2 + . . . + 3 2 + 1 2 ) (40^2+38^2+...+4^2+2^2)-(39^2+37^2+...+3^2+1^2)

= ( 4 0 2 3 9 2 ) + ( 3 8 2 3 7 2 ) + . . . + ( 4 2 3 2 ) + ( 2 2 1 2 ) =(40^2-39^2)+(38^2-37^2)+...+(4^2-3^2)+(2^2-1^2)

= ( 40 + 39 ) ( 40 39 ) + ( 38 + 37 ) ( 38 37 ) + . . . + ( 4 + 3 ) ( 4 3 ) + ( 2 + 1 ) ( 2 1 ) =(40+39)(40-39)+(38+37)(38-37)+...+(4+3)(4-3)+(2+1)(2-1)

= ( 40 + 39 ) + ( 38 + 37 ) + . . . ( 4 + 3 ) + ( 2 + 1 ) =(40+39)+(38+37)+...(4+3)+(2+1)

= 40 + 39 + 38 + 37 + . . . + 4 + 3 + 2 + 1 =40+39+38+37+...+4+3+2+1

Now it's just a simple arithmetic progression... It's the sum of first 40 positive integers...

We know the formula for finding out the sum of first n n positive integers...

That is, n ( n + 1 ) 2 \frac {n(n+1)}{2}

Simple plugging in n = 40 n=40 , we get...

40 × ( 40 + 1 ) 2 = 40 × 41 2 = 20 × 41 = 820 \frac {40 \times (40+1)}{2} = \frac {40 \times 41}{2} = 20 \times 41 = 820

Hence, the required answer is 820 \fbox {820}

Inderjit Kaur
Sep 1, 2013

Find the difference of 40 squared and then 39 squared and do the same for 38 squared and 37 squared. Compare both and u will realise as the number go down they reduce by 4. So take 79 and keep minus with 4 till you reach 3 because the last one is 2 squared minus 1 squared which is 3.

The question can be broken into two series:

First series is the sum of squares of first 20 even natural numbers: ( 4 0 2 + 3 8 2 + . . . + 4 2 + 2 2 ) (40^2 + 38^2 + ... + 4^2 + 2^2)

Second series is the sum of squares of first 20 odd natural numbers: ( 3 9 2 + 3 7 2 + . . . + 3 2 + 1 2 ) (39^2 + 37^2 + ... + 3^2 + 1^2)

The answer is the difference between these two sums.

Therefore,

( 4 0 2 + 3 8 2 + . . . + 4 2 + 2 2 ) (40^2 + 38^2 + ... + 4^2 + 2^2) = 2 n ( n + 1 ) ( 2 n + 1 ) 3 = \frac{2n(n + 1)(2n + 1)}{3} = 2.20. ( 20 + 1 ) ( 2.20 + 1 ) 3 = 11480 = \frac{2 . 20 . (20 + 1)(2 . 20 + 1)}{3} = 11480

and

( 3 9 2 + 3 7 2 + . . . + 3 2 + 1 2 ) (39^2 + 37^2 + ... + 3^2 + 1^2) = n ( 2 n 1 ) ( 2 n + 1 ) 3 = \frac{n(2n - 1) (2n + 1)}{3} = 20. ( 2.20 1 ) ( 2.20 + 1 ) 3 = 10660 = \frac{20 . (2 . 20 - 1) (2 . 20 + 1)}{3} = 10660

Hence, the final solution,

( 4 0 2 + 3 8 2 + . . . + 4 2 + 2 2 ) ( 3 9 2 + 3 7 2 + . . . + 3 2 + 1 2 ) (40^2 + 38^2 + ... + 4^2 + 2^2) - (39^2 + 37^2 + ... + 3^2 + 1^2) = 11480 10660 = 11480 - 10660 = 820 =820 which is the required answer.

Henry Okafor
Aug 30, 2013

( 4 0 2 40^{2} - 3 9 2 39^{2} )+( 3 8 2 38^{2} - 3 7 2 37^{2} )+...+( 2 2 2^{2} - 1 2 1^{2} )=(40+39)(40-39)+(38+37)(38-37)+...(2+1)(2-1)=40+39+38+37+...+2+1=820

40^2-39^2 +38^2-37^2............. 2^2-1^2 (40+39)(40-39)+(38+37)(38-37)..............................(2+1)(2-1) Taking one common , we get 1* (1+2+3+4+5........................40) 1*(40(40+1)/2 = 820

You could've used formatting to make your solution more readable.

Kou$htav Chakrabarty - 7 years, 9 months ago
Abhro Rahman
Aug 28, 2013

I know that this isn't the correct way, but I used the following python code:

list_1=[x**2 for x in range(2,41,2)]
list_2=[x**2 for x in range(1,40,2)]
print sum(list_1)-sum(list_2)
Tamoghna Banerjee
Aug 26, 2013

On opening the brackets and rearranging the given sequence it follows -

(40^2 - 39^2) + (38^2 - 37^2) + (36^2 - 35^2) + ......... +(2^2 - 1^2) this implies, (40+39)(40-39) + (38+37)(38-37) + ........... +(2+1)(2-1) this implies, (40+39)(1) + (38+37)(1) + ....... +(2+1)(1) this implies, 40+39+38+37+.......+2+1

Ronald Salim
Aug 26, 2013

(40^2-39^2)+(38^2-37^2)+...+(2^2-1^2)=

(40+39)(40-39)+(38+37)(38-37)+...+(2+1)(2-1)=

79+75+...+3=

(20/2)(79+3)=(10)(82)=820

I think in last step u used AP.

Sakshi Yadav - 7 years, 9 months ago
Rakhmat Muliawan
Aug 25, 2013

(40^2 + 38^2 +…+ 4^2 + 2^2) − (39^2 + 37^2+…+3^2 + 1^2) = (40^2 - 39^2) + (38^2 - 37^2) +...+(4^2 - 3^2) + (2^2 - 1^2) = 79 + 75 + 71 + 67 + ....+ 11 + 7 + 3 = 20/2 (79 + 3) = 10 x 82 = 820

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...