function res = hk(t,gama,mmax,k,vap)

s = 0;
r = [];
vr = [];
a = log(2)/log(3);
l = length(vap);

for j = 1:l
    for m = 1:(2*mmax+1)
    vr(j,m) = (vap(j)+2)^(-a-2*i*pi*(m-1-mmax)/log(3));
    end;
end;

for m = 1:(2*mmax+1)
    r(m) = l^(-1)*sum(vr(:,m));
end;

for m = 1:(2*mmax+1)
    s = s+exp(-2*i*pi*(m-1-mmax)*log(t)/(log(3)))*exp(-i*(k + a +2*i*pi*(m-1-mmax)/log(3))*pi/2)*gama(k+1,m)*(a+2*i*(m-1-mmax)/log(3))^(-1)*r(m);
end;

res = t^(-k-a)*s;
    
    
end

