Find $p$ that minimizes $\frac{p-1}{p^n-1}\sum_{i=1}^n(n-i) p^{i-1} $ Given the following formula:
$$
S= \frac{p-1}{p^n-1}\sum_{i=1}^n(n-i) p^{i-1} 
$$
If p=1: 
$$
 S= (n-1) /2
$$ 
If p=2:
$$
S= \frac{1}{2^n-1}\sum_{i=1}^n(n-i)2^{i-1}
$$
If p=3:
$$
S= \frac{2}{3^n-1}\sum_{i=1}^n(n-i)3^{i-1}
$$
And so on.
What is the value of p that gives the minimum value to S while n takes the maximum value possible?
What is the right approach to solve this?
Thank you in advance
 A: In the following I shall assume that $p \ge 0$ and $n \in \mathbb N \setminus \{0\}$. If $n=1$ then $S=0$. If $n=2$ then $S= \frac 1 {p+1}$ which clearly doesn't have a minimum on $[0, \infty)$, but only an infimum at $\infty$, which is $0$.
Let us assume now that $n \ge 3$. Since
$$S(p) =  \frac {p-1} {p^n-1} \sum _{i=1} ^n (n-i) p^{i-1} = \frac 1 {1 + p + \dots + p^{n-1}} \sum _{i=1} ^n (n-i) p^{i-1} \ ,$$
the indeterminacy at $p=1$ can be removed and $S$ may be extended by continuity at $p=1$ with the value $\frac 1 n \sum _{i=1} ^n 1 = \frac {n-1} 2$.
Notice that, by a simple visual examination, since $\frac {p-1} {p^n - 1} \ge 0$ and $n-i \ge 0 \ \forall 1 \le i \le n$, it follows that $S \ge 0$. Notice also that the value $0$ cannot be reached at any $p$:
$$S(p) = \frac 1 {1 + p + \dots + p^{n-1}} \sum _{i=1} ^n (n-i) p^{i-1} = \frac 1 {1 + p + \dots + p^{n-1}} \left ( n-1 + \sum _{i=2} ^n (n-i) p^{i-1} \right) \ge \\
\ge \frac {n-1} {1 + p + \dots + p^{n-1}} > 0$$
because $n \ge 3$.
On the other hand, since $(n-i) p^{i-1} = 0$ for $i=n$ and $p \ne 0$, the last term in the sum may be dropped, so
$$\lim _{p \to \infty} S(p) = \sum _{i=1} ^{\color{red} {n-1}} (n-i) \lim _{p \to \infty} \frac {p^i - p^{i-1}} {p^n - 1} = 0$$
because you only look at the greatest powers in those fractions, so
$$\lim _{p \to \infty} \frac {p^i - p^{i-1}} {p^n - 1} = \lim _{p \to \infty} \frac {p^i} {p^n} = \lim _{p \to \infty} \frac 1 {p^{n-i}} = 0$$
for $0 \le i \le n-1$ (this is where we use that we drop the term corresponding to $i=n$ from the sum).
We conclude that $S$ is positive and goes arbitrarily close to $0$ but, at the same time, it never takes this value, so $0$ is a global infimum but not a global minimum (by definition, the minimum must be reached, the infimum not necessarily). There is no global minimum.
A: I'm not exactly clear what your end goal is, but perhaps by finding a closed-form expression for $S$ you can see your way through to the end.  Here's how:
We have
$$
\sum_{i=1}^n (n - i)p^{i-1} = \frac{n}{p} \left[ \sum_{i=1}^n p^i \right] - \left[\sum_{i=1}^n i p^{i-1} \right].
$$
The first sum can be expressed via the standard geometric series:
$$
 \sum_{i=1}^n p^i = p \sum_{i=0}^{n-1} p^i = \frac{p (p^{n} - 1) }{p - 1}.
$$
For the second one, we note that
$$
\sum_{i=1}^n i p^{i-1} = \frac{d}{dp} \left[ \sum_{i=1}^n p^i \right] = \frac{d}{dp} \left[ \frac{p (p^{n} - 1) }{p - 1} \right] = \frac{n p^{n+1} - (n+1) p^n + 1}{(p- 1)^2}.
$$
Thus, the sum can be written in closed form as
$$
\sum_{i=1}^n (n - i)p^{i-1} = \frac{n (p^{n} - 1) }{p - 1} - \frac{n p^{n+1} - (n+1) p^n + 1}{(p- 1)^2} = \frac{ p^n - n p + n - 1}{(p-1)^2},
$$
and the full expression is
$$
S = \frac{ p^n - np + n-1}{(p-1)(p^n-1)} = \frac{1}{p - 1} - \frac{n}{p^n - 1}.
$$
For a fixed $n$, this expression is extremized when $dS/dp = 0$, or
$$
\frac{dS}{dp} = \frac{n^2 p^{n-1}}{(p^n - 1)^2}  - \frac{1}{(p-1)^2} = 0.
$$
It appears (after plotting $S$ as a function of $p$ for various $n$ values) that $dS/dp < 0$ for all $p > 0$ and all $n$.  If this holds, it means that there is not a local minimum for $S$;  the expression is maximized at $p = 0$, and is minimized by taking $p$ as large as possible.  This said, I don't see a quick and easy way to prove that $dS/dp$ is strictly negative, so this result should be taken with a grain of salt until it's rigorously proven.
