# Checking result for expression

I want to verify the following result: $\sum _{y=2}^{n+1} \left(\sum _{x=y-1}^n \frac{1}{x-y}\right)=n \left(H_n^{(1)}-1\right)$

In Mathematica i try with:

Sum[Sum[1/(x - y), {x, y - 1, n}], {y, 2, n + 1}] == n*(HarmonicNumber[n, 1] - 1)


But I don't understand Mathematica output, is a large formula. And WolframAlpha doesn't say anything for it.

• What happens at x=y in the inner sum ? Jan 21, 2014 at 21:19
• @b.gatessucks What happens?, sorry, i don't understand what you ask. Jan 21, 2014 at 21:21
• If x can equal y in the inner sum I think you have an infinity. Jan 21, 2014 at 21:24

I think you might have a few transcription errors in the result you are attempting to demonstrate -- as b.gatessucks has pointed out, as written, $x$ can equal $y$ in the denominator in the inner sum. However, if I make the following minor amendments to your statement: $\sum_{y=1}^{n}\left(\sum_{x=y+1}^{n}\frac{1}{x-y}\right) = n \left(H_{n}^{(1)} - 1\right)$, then Mathematica is able to verify the result:
FullSimplify[Sum[Sum[1/(x - y), {x, y + 1, n}], {y, 1, n}] == n (HarmonicNumber[n] - 1)]

returns True.
• Im confused here. Look, the original sum to do (in mi homework) is: $\left.\sum _{x=1}^n \left(\sum _{y=2}^{x+1} \frac{1}{x-y}\right)\right]$. There is a sugerence, it says that could be of help to interchange the order of the sum, so i did that and i have then: $\sum _{y=2}^{n+1} \left(\sum _{x=y-1}^n \frac{1}{x-y}\right)$. Your solution doesnt give the same result than the original sum that is proposed in mi homework. The result for the original is (with FullSimplify): $\sum _{x=1}^n (\psi ^{(0)}(2-x)+\gamma -1)$. Jan 22, 2014 at 0:56
• Im saying that $\left.\sum _{x=1}^n \left(\sum _{y=2}^{x+1} \frac{1}{x-y}\right)\right]$ must be equal to $\sum _{y=2}^{n+1} \left(\sum _{x=y-1}^n \frac{1}{x-y}\right)$. Jan 22, 2014 at 1:07
• Wyvern666: Are you sure about the starting form for your homework problem? Consider the case where $x=2$ in the outer sum and $y=2$ in the inner sum -- you get 1/0, which is nonsensical. The same thing happens for $x=y=3$ and so on. If it truly is $x-y$ in the denominator, then the indices on the inner sum should be set up to ensure $y < x \forall x,y$. That motivated my "guess" as to how to "correct" the statement to yield the desired identity. Jan 22, 2014 at 1:19