In delving into Ramanujan summation, I'm trying to get a hold of the relations of the form
$$\sum_{n=0}^\infty f(n)=\dfrac{h\frac{d}{dx}}{{\mathrm{e}^{h\frac{d}{dx}}}-1}\int_{0}^\infty f(x)\,{\mathrm{d}x}.$$
To express the right hand side in Mathematica, I might introduce an auxillary parameter in place of $\frac{d}{dx}$ and then do pattern to find the powers $\frac{d^k}{dx^k}f(x)$.
But it appears to me that I can actually avoid the shift operation $\mathrm{e}^{h\frac{d}{dx}}$ by expanding the quotient of infinitesimal vs. finite difference and do pattern matching for the result. So I'd like to the result of
Df = f'[x];
Dhf = (f[x + h] - f[x])/h;
Series[-Df/Dhf, {h, 0, 3}]
and replace each factor of $\dfrac{\prod_i f^{(a_i)}(x)^{b_i}}{f'(x)^c}$ with $\left(\frac{d}{dx}\right)^{\sum_ia_i\cdot b_i-c-1}$. For example,
The expression in the first coefficient $\dfrac{f^{(2)}(x)^1}{f'(x)^1}$ becomes $f^{(2\cdot 1-1-1)}(x)=f(x)$.
The expression $\dfrac{f'(x)\,f^{(3)}(x)}{f'(x)^2}$, which is part of the second coefficient becomes $f^{(1\cdot 1+3\cdot 1-2-1)}(x)=f'(x)$.
What happens is that the individual $f$-fraction in the term coefficient of $h^n$ are substituted with $f^{(n-1)}$. But it's relevant to keep all right the numerical coeffients, $\frac{1}{2}, -\frac{1}{12}$, etc.
(In the end I want to plug in $f(n):=n$, remove the leading coeffient by adding $1$ to the expression, evaluate at $n=0$ and obtain $1+2+3+\dots=-\frac{1}{12}$.)
I'm experimenting with the replace function, but I'm getting Tag-messages and I'm not sure if I need to order the terms for Mathematica to see what I want. How do I perform the above replacement of terms? This is the technique I want to learn here.
What I do can do is use
$\frac{1}{a}=\frac{1}{1-(1-a)}=1+(1-a)+(1-a)^2+\dots$
and obtain
-Sum[
(1 - Series[f[x + h] - f[x], {h, 0, 3}]/h)^k,
{k, 0, 2}]
% /. {D[f[x], {x, n_}] -> 1}
but this is only an approximation and the expansion mixes up the orders of differentiation.