Can you give me some hints on solving following summation. Is there any theory concerning the following summation?
$p$ is a prime number > 2
$$\sum_{s=2}^{p-1}\left(\left\lfloor\frac{p}{s}\right\rfloor s\right)$$
I tried to apply the following formula
$$\left\lfloor \frac{x}{y}\right\rfloor = \frac{x - (x\mod{y})}{y}.$$
But it does not get me anything useful.
Thanks in Advance.
This sum is very similar to a well-known formula for the sum of sum of divisors function OEIS A024916:
$$\sum_{k=1}^n \sigma(k) = \sum_{k=1}^n \left\lfloor \frac n k\right\rfloor k$$
which can be computed in sub-linear time as I show here.
This formula is easily seen by writing out all the divisors in a triangular grid. Example for $n=6$:
\begin{matrix} k=1: & 1 \\ k=2: & 1 & 2 \\ k=3: & 1 & & 3 \\ k=4: & 1 & 2 & & 4 \\ k=5: & 1 & & & & 5 \\ k=6: & 1 & 2 & 3 & & & 6 \end{matrix}
Summing columnwise it is easy to see for every value $k$ from $1$ to $n$, $k$ will appear $\lfloor n / k \rfloor$ times, so we add $\left\lfloor n/k\right\rfloor k$ to the total sum. For your particular case we leave out $k=1$ and $k=n$.