Let $a_n = \int_{-1}^{n}\left(1 + \frac{x}{2} + \frac{x^2}{3} + \ldots + \frac{x^{n-1}}{n}\right)dx$ for every $n \in N$. Then the sum of all the elements of the set $\{n \in N : a_n \in (2, 30)\}$ is ______.
Numerical-value question: the answer is a number.
Show answer
The answer is 5.
Key from source paper