sympy/sympy — pull request #1855 by raoulb (2013-03-02 02:35:26+00:00)
Title: Rewrite of harmonic numbers into summation

Rewrite of harmonic numbers into symbolic sums:

```
In [4]: harmonic(n)
Out[4]: harmonic(n)

In [5]: _.rewrite(Sum)
Out[5]: Sum(1/_k, (_k, 1, n))

In [6]: pprint(_)
n
____
╲
╲ 1
╲ ─
╱ k
╱
╱
‾‾‾‾
k = 1

In [7]: _.subs(n, 10)
Out[7]: Sum(1/_k, (_k, 1, 10))

In [8]: _.doit()
Out[8]: 7381/2520
```