0
$\begingroup$

I am currently studying for an Algorithms class. In my notes from class and in the my textbook, there is not a similar example I can reference. I have worked on the problem and gone to tutoring, but I can not seem to get the correct answer.

Can anyone give me any tips on how to solve this problem?

Evaluate the summation, where $a$ is a constant, $a \neq 1$.

a) $\displaystyle\sum_{i={10}}^n (a^i+n)$, where $a\neq 1$.

Thank you in advance.

  • 1
    There aren't three variables in the sumation, there is only one ($n$);$a$is a fixed quantity, so it does not *vary*, and $i$ is the index of the summation.2011-01-27

2 Answers 2

2

You can divide the sum into a sum of powers of $a$, and a sum of $n$. The latter is trivial.

For the former, you are obviously expected to use the formula for the sum of a geometric series.

0

By three variables do you mean a,n, and i?

You will have to choose one value for a and n. i will go from 10 to n.

For example if a = 3 and n=20 your pseudocode would be:

int a =3; int n = 20 answer = 0; for(i=10:i==n;i++){answer += a^i+ n}

There are more elegant ways, but this is a tiny assignement. Arturo is right that you could use the formula for a geometric series too.