In mathematics, the harmonic series is the divergent infinite series:
Its name derives from the concept of overtones, or harmonics in music.
Create a function that, given a precision parameter n, returns the value of the partial sum of the harmonic series up to n terms.
harmonic(3) ➞ 1.833
harmonic(1) ➞ 1.0
harmonic(5) ➞ 2.283
Round the result to the third decimal place.