3

This is the formula:
$\sum_{i=1}^n x^i = a$

For example: $\sum_{i=1}^4 3^i = 120.$

If we have x and a, is it possible to obtain n?

ps: I'm sorry if it's a silly question!

ali
  • 33

1 Answers1

3

Notice that $\sum_{i=1}^n x^i = x + x^2+ \cdots + x^n$ is a sum of a geometric progression, and we know a closed expression for it: $$\sum_{i=1}^n x^i = \frac{x(1-x^n)}{1-x}.$$ If you have a result, $a$, and $x$ is known, then we have: $$\frac{x(1-x^n)}{1-x} = a \implies n = \log_x\left(1-\frac{a(1-x)}{x}\right).$$ If the result is really possible, then the RHS will be a natural number.


In general, if we have a geometric progression $(a_1,\ldots, a_n, \ldots)$, with $q = a_{n+1}/a_n$, then: $$S_n = a_1\frac{1-q^n}{1-q}.$$

Ivo Terek
  • 77,665