Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the below function to compute the Hurwitz zeta function from Riemann zeta function. But I am not getting the correct results when compared with the value of Wolfram alpha Hurwitz zeta function. I am suspecting some issues with floating point errors but not sure. Can someone help me out with the explanation ?

function h=hzeta(s,q) z = zeta(s) h = z - sum((1:(q-1)).^(-s));

where q=1-500 and s=1-7


share|cite|improve this question

It's rather hard to explain your results if you don't say what your results are. For example $\zeta(2) = 1.644934067$ while $\zeta(2,3) = .3949340668 = \zeta(2) - (1/1^2 + 1/2^2)$. What do you get?

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.