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.
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.