The string center describes a helix around the cylinder with parametric equation given by
#p(t) = ((r+h/2)cost,(r+h/2)sint, alpha t)#
the helix pitch is calculated with the condition
#p(t+2pi)-p(t)=(0,0,h)#
so we have #alpha (2pi) = h -> alpha = h/(2pi)#
The string is wounded around the cylinder from #t=0# to #t = t_f# and we know that
#t_f h/(2pi) = n -> t_f = (2pi n)/h#
the string length is given by
#l = int_(t=0)^(t=t_f) (ds)/(dt) dt#
Here #d/(dt) p(t) = (-(h/2 + r) sint, (h/2 + r) cost, h/(2pi)) = ((dx)/(dt),(dy)/(dt), (dz)/(dt))#
and #(ds)/(dt) = sqrt(((dx)/(dt))^2+((dy)/(dt))^2+((dz)/(dt))^2)#
giving
#(ds)/(dt) = sqrt((h^2 (1 + pi^2))/(4 pi^2) + h r + r^2)#
so finally
#l = (npi)/h sqrt((h^2 (1 + pi^2))/(4 pi^2) + h r + r^2)#
substituting #r=3/pi# the result is
#l=(n sqrt[36 + h (h + 12 pi+ h pi^2)])/h#