# How do you write the summation of a summation?

Like how should you do it and how do you manipulate it algebraically?

$$S = \{1/2, 1/3, \ldots, 1/n\}$$

$$Q = \{S(2), S(3), \ldots, S(n)\}$$

-
Are you looking for how to write it or how to solve it? –  Mike Nov 16 '12 at 18:29
I just remembered, a sum very closely related to this one appears here (mathworld.wolfram.com/HarmonicNumber.html) under the name “second-order harmonic number”. –  Max Morin Nov 16 '12 at 19:49

The sum in your question can be written as something like $$\sum_{i=2}^n\sum_{j=2}^i \frac{1}{j}.$$ This might not be exactly what you want, it is not clear what $S(1)$ is supposed to be in your question. As for how to manipulate multiple sums, it depends on the sum. I suggest the book “Concrete Mathematics” by Graham, Knuth and Patashnik. This specific sum can be made into a single sum by grouping the terms $\frac{1}{k}$ by themselves for each $k$.

Edit: The sum above can be written as \begin{align}&\frac{1}{2}+\\\\ &\frac{1}{2}+\frac{1}{3}+\\\\ &\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\\\\ &\vdots\\\\ &\frac{1}{2}+\frac{1}{3}+\dots+\frac{1}{n}\end{align} Here each line is the term for a specific $i$, the $i$ is how big the denominator may be on each line. If you want to transform this to a single sum, add all the above by columns instead of rows. Then you get $$\sum_{i=2}^n (n-i+1)\frac{1}{i}.$$

-
s(1) is an error, i meant s(2) and s(3) –  George Nov 16 '12 at 18:39
shouldn't it be n instead of i? –  George Nov 16 '12 at 18:44
No, the inner sum will be $1/2$ for $i=2$, $1/2+1/3$ for $i=3$ and so on. If we had the inner sum from $2$ to $n$, we would get $1/2+1/3+\dots+1/n$ for each $i$, and thus the sum would be $(n-1)(1/2+1/3+\dots+1/n)$ –  Max Morin Nov 16 '12 at 18:47
$\sum_{i=2}^n\sum_{j=2}^i \frac{1}{j}$ the i in this is not fixed (i = 2), but can got up to the value n? –  George Nov 16 '12 at 19:04
@George: Yes you should read "$\sum_{i=2}^n\sum_{j=2}^i \frac{1}{j}$" as "$\sum_{i=2}^n a_i$ where $a_i = \sum_{j=2}^i \frac{1}{j}$". (It's like nested loops in programming, if you're perchance familiar with that: "for i = 2 to n: for j = 2 to i: increase sum by 1/j".) –  ShreevatsaR Nov 16 '12 at 19:11

As for the question in your title, it sounds like you want

$$Q=\sum\limits_{i=2}^nS(i)\text{ and } S(n)=\sum\limits_{i=1}^{n-1}\frac1{i+1}$$

Combining the 2 gives

$$Q=\sum\limits_{i=2}^n\sum\limits_{j=1}^{i-1}\frac1{j+1}$$

-
shouldn't it be n-1 instead of i? –  George Nov 16 '12 at 18:47
each summations have n-1 elements –  George Nov 16 '12 at 18:47
Oops. I see you changed your problem slightly as well. Couple small corrections coming. –  Mike Nov 16 '12 at 18:53

I would use a matrix-notation. I assume your original values are in a vector S, say
$S=[a,b,c,d]$ and then I'd express the transformation to the vector Q using the triangular matrix D with

$$D= \begin{bmatrix} 1 \\ 1 & 1 \\ 1&1&1 \\ 1&1&1&1 \end{bmatrix}$$ writing $$D \cdot S = Q$$ Then the sums of higher orders can be expressed by powers of $D$. If again we write $S(0)=S, \\ S(1)=Q=D \cdot S(0) , \\ S(2) = D^2 \cdot S(0), \\ ..., \\ S(k)=D^k \cdot S(0)$
then we can describe the entries of $D^k$ using a formula involving the matrix-exponential and matrixlogarithm $$D^k = \exp(k \cdot \log(D))$$ The entries of $D^k$ are then $$\begin{bmatrix} 1 & . & . & . & . \\ k & 1 & . & . & . \\ { k^2+k \over 2!}& k & 1 & . & . \\ {k^3+3 k^2+2 k \over 3!} & k^2+k & k & 1 & . \\ {k^4+6 k^3+11 k^2+6 k \over 4!} & {k^3+3 k^2+2 k \over 3!} & {k^2+k \over 2!} & k & 1 \\ \ldots \end{bmatrix}$$ where we easily recognize the set of Stirling numbers in the numerators of the left-most column. (The other columns are only down-shiftings of the first column).

Additional remark: I find it aesthetically much pleasing, that using that exp(k log()) scheme for the matrix-powers, we have automatically defined a meaningful interpolation to fractional values of the iteration - just insert fractional values for k in the symbolic description of the k'th power of D...

A table for the 0'th, 1st ,2nd and 200'th order of that sums taking your example is $$\begin{array} {r|r|r|r|r|r|r} S(0) & S(1)=Q & S(2) & S(200) \\ \hline \\ 1/2 & 1/2 & 1/2 & 1/2 \\ 1/3 & 5/6 & 4/3 & 301/3 \\ 1/4 & 13/12 & 29/12 & 121403/12 \\ 1/5 & 77/60 & 37/10 & 3417251/5 \\ 1/6 & 29/20 & 103/20 & 69597447/2 \\ 1/7 & 223/140 & 236/35 & 9970887081/7 \end{array}$$

-