Let $\varphi$ denote the Euler's totient function. Is there any reference in literature for the value of sum $$\sum\_{\substack{r\le x\\ d\mid r}}\gcd(\phi(d),r)$$ where $d$ is some fixed positive integer?


Thanks in advance.



Asymptotic for a sum involving GCD and Euler totient function
Let $c:=\gcd(\phi(d),d)$. then setting $r:=dk$ the sum can be rewritten as
$$c\sum\_{k\leq x/d} \gcd(\tfrac{\phi(d)}c,k) \approx \frac{c^2x}{d\phi(d)}f(\tfrac{\phi(d)}c),$$
where $f(m) := \sum\_{k=1}^m \gcd(k,m)$ is the multiplicative function given by its values on prime powers $f(p^s) = p^{s-1}((p-1)s+p)$. See also [OEIS A018804](https://oeis.org/A018804).


