I am reading the paper Mass Equidistribution for Hecke Eigenforms by Luo and Sarnak. In the paper there is the following equality:
By the multiplicativity of Hecke eigenvalues, we have $$ \sum_{r\geq 1}\lambda_f(r)\lambda_f(r+m)h\left(\frac{k-1}{4\pi\left(r+\frac{m}{2}\right)}\right)$$ $$=\sum_{d\mid m}\sum_{r\geq 1}\lambda_f\left(r\left(r+\frac{m}{d}\right)\right)h\left(\frac{k-1}{4\pi d\left(r+\frac{m}{2d}\right)}\right)$$
In the above, we have that $\lambda_f(r)$ is the $r$-th (normalized) Hecke eigenvalue of a modular form $f$ of weight $k$ (these will be multiplicative in the input). Let's take $m$ to be some positive integer, and we have that $h\in C_0^\infty(0,\infty)$ is just a compactly supported smooth function on $(0,\infty)$.
Now I am confused as to how this equality is derived as it seems to me that assuming $(r,m)=1$, then the $d=1$ term in the sum over $d\mid m$ on the right-hand side of the equality is just the left-hand side of the equality, but I don't see how the other terms might cancel out to be $0$. I'm just confused as to how we get the sum over $d\mid m$ in general (I assume this might have to do with Hecke relations somehow, but I don't know how or might be wrong). If someone is able to help me see how this equality is derived, I would greatly appreciate it.
Thanks to Peter's comment, I now see how it works, and will type out a solution. Thus, we are beginning with $$ \sum_{r\geq 1}\lambda_f(r)\lambda_f(r+m)h\left(\frac{k-1}{4\pi(r+\frac{m}{2})}\right) $$ Now using the Hecke relation that Peter pointed out, we have that the above becomes $$ \sum_{r\geq 1}\sum_{d\mid (r,r+m)}\lambda_f\left(\frac{r(r+m)}{d^2}\right)h\left(\frac{k-1}{4\pi(r+\frac{m}{2})}\right) $$ Now we make the observation that $(r,r+m)=(r,m)$. Thus, as $m$ is fixed and $r$ varies, we will have to eventually pass over all $d\mid m$, so if we interchange the sums and sum over $d\mid m$ first, then we only include these corresponding values of $r$ if $d\mid r$ that is if $r\equiv 0\pmod{d}$. That is we get: $$ \sum_{d\mid m}\sum_{\substack{r\geq 1\\ r\equiv 0\pmod{d}}}\lambda_f\left(\frac{r(r+m)}{d^2}\right)h\left(\frac{k-1}{4\pi(r+\frac{m}{2})}\right) $$ Now if we look at the sum over $r\equiv 0\pmod{d}$, we will have that after doing the change of variables $r\mapsto dr$, then this will just become the sum over all $r\geq 1$, and we arrive at $$ \sum_{d\mid m}\sum_{\substack{r\geq 1\\ r\equiv 0\pmod{d}}}\lambda_f\left(r\left(r+\frac{m}{d}\right)\right)h\left(\frac{k-1}{4\pi d(r+\frac{m}{2d})}\right) $$ which is exactly what I wanted. Again big thanks Peter for helping me figure this out.