Does anyone know a function that can describe a harmonic series? I want to find a function that satisfies the following functional equation:
$F(z+1)=1/z+F(z)$
This is a generalization of harmonic series 1 + 1/2 + 1/3 + 1/4 + ..., and is similar to the gamma function which satisfies the relation $F(z+1)=zF(z)$.
I searched the internet. However, I didn't find such a function. Could anyone tell me something about this function?
 A: In Mathematica, such a recursion may be solved with
RSolve[{f[z + 1] == f[z] + 1/z, f[1] == 1}, f[z], z]

where I assumed an initial condition of $f[1]=1$. The solution returned is
f[z] -> 1 + EulerGamma + PolyGamma[0, z]

A: Clear[f, f1, f2]

f1[z_] = Sum[1/k, {k, z - 1}]

(*  HarmonicNumber[-1 + z]  *)

Although this definition is for positive integers, the result is valid for all z except non-positive integers.
Plot[f1[z], {z, -5.9, 10}, Exclusions -> Range[-5, 0], 
 PlotRange -> {-5, 5}]


HarmonicNumber[-1 + z] // FunctionExpand

(*  EulerGamma + PolyGamma[0, z]  *)

Alternatively,
f2[z_] = f[z] /. 
  RSolve[{f[z + 1] == 1/z + f[z], f[1] == 0}, f[z], z][[1]]

(*  EulerGamma + PolyGamma[0, z]  *)

Plot[f2[z], {z, -5.9, 10}, Exclusions -> Range[-5, 0], 
 PlotRange -> {-5, 5}]


FullSimplify[f1[z] == f2[z], z > 0]

(*  True  *)

FullSimplify[f1[z] == f2[z], z < 0 && Not[Element[z, Integers]]]

(*  True  *)

Even for complex numbers
f1[1. + I]

(*  0.671866 + 1.07667 I  *)

f1[1. + I] == f2[1. + I]

(*  True  *)

