SAFWAN.K's blog

By SAFWAN.K, history, 9 years ago, In English

Hi all Is there a formula to find the sum of the following series

i<=j

i*j+(i-1)*(j-1)+...+(i-i)*(j-i)

thank you all

  • Vote: I like it
  • +7
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
Rev. 5   Vote: I like it 0 Vote: I do not like it

($ i*j + (i-1)*(j-1) + (i-2)*(j-2) + ... + (i-i)*(j-i)))

= i*j + i*j-i-j+1 + i*j-2*i-2*j+4 + ... + i*j-i*i-i*j+i*i

= i*j*(i+1) + (1+2+...+i)*(i+j) + 1^2+2^2+...+i^2

= i*j*(i+1) + i*(i+1)*(i+j)/2 + i*(i+1)*(2*i+1)/6

PS: Why TEX markup didn't work?

  • »
    »
    9 years ago, # ^ |
    Rev. 2   Vote: I like it +7 Vote: I do not like it

    i am get it thank you there are mistake in your formula this is true : i * i * j — (i + j) * (i — 1) * i / 2 + (i — 1) * (i)* (2*(i — 1) + 1) / 6

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    i don't know about tex markup

»
9 years ago, # |
  Vote: I like it +3 Vote: I do not like it

may be this i*(i+1)*(2i+1)/6 + (i*(i+1ll)/2ll) * (j-i)

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Yes, there is. I take it you're trying to solve problem D from last contest, because this is exactly the formula for that one. Consider i ≤ j (the other case is analogous), then you can transform the expression into...

(i2 + i * (j - i)) + ((i - 1)2 + (i - 1) * (j - i)) + ... + (22 + 2 * (j - i)) + (12 + 1 * (j - i))

That's the sum of squares plus the sum of numbers multiplied by j - i, so we can express it as...

»
9 years ago, # |
  Vote: I like it +8 Vote: I do not like it

why is votes down :/ ?