I'm using a function involving a sum where some indices are excluded:
f[s_] := Sum[
MoebiusMu[n]/n Log[Zeta[n s] (n s - 1)], {n,
DeleteCases[Range[1, 10], 1/s]}];
f[1] // N
f'[1] // N
f[1]
works properly, but f'[1]
yields an error because the exclusion is not respected. If I print f'[s]
or even f[s]
, I can see that the excluded index is not actually being excluded in the symbolic expression.
How can I make Mathematica respect the exclusion? I also tried
f[s_] := Sum[
If[n == 1/s, 0, MoebiusMu[n]/n Log[Zeta[n s] (n s - 1)]], {n, 1,
10}];
But then printing f'[s]
shows that the n
are not being substituted into the third argument of If
.