You are not logged in. Please login at www.codechef.com to post your questions!

×

How to calculate certain sum? [with detailed answer]

alt text

asked 17 Jan '13, 19:10

lashabuxo's gravatar image

3★lashabuxo
73158
accept rate: 0%

edited 17 Jan '13, 21:14

anton_lunyov's gravatar image

6★anton_lunyov ♦
6.7k62119138

I don't quite understand your question. Are you asking how to translate the above expression to code ? Please clarify

(17 Jan '13, 19:18) junior944★

no this is math problem,i want to know what is it

(17 Jan '13, 19:25) lashabuxo3★

@lashabuxo
No way you can delete this now after I write the explanation :P
If it is your homework and you don't want others to see that you ask for help then it will be a lesson to you.

(17 Jan '13, 21:15) anton_lunyov ♦6★

It is a simple exercise on sum of the geometric progression.
We have by the formula
(a + b)^2 = a^2 + 2 * a * b + b^2
that
Sum[(2^k + 1/2^k)^2 : 1<=k<=n] =
Sum[2^(2 * k) + 2 + 1/(2^(2 * k)) : 1<=k<=n] =
2 * n + Sum[4^k + (1/4)^k : 1<=k<=n] =
2 * n + (4^n-1) * 4/3 - ((1/4)^n-1) * 1/3 =
1/3 * (-3 - 4^(-n) + 4^(1 + n) + 6 * n)

Also refer to this

http://www.wolframalpha.com/input/?i=Sum[%282^k+%2B+1%2F2^k%29^2%2C+{k%2C+1%2C+n}]

link

answered 17 Jan '13, 19:34

anton_lunyov's gravatar image

6★anton_lunyov ♦
6.7k62119138
accept rate: 12%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×890

question asked: 17 Jan '13, 19:10

question was seen: 764 times

last updated: 17 Jan '13, 21:15