A few more ideas: using the chebyshev upper boundin the form , by partial summation we have $\sum_{p>y}p^{-2} \ll 1/y \sum_{p>y}p^{-2}=O(\frac{1}{y \log y$ y})$and therefore we see that$s(n)=\sum_{p \leq \frac{n}{\log n}}\frac{(p-1,n)}{p^2}+O(1).$Furthermore by the equality$\sum_{p \leq x}p^{-1}=\log \log x +A +(\frac{1}{\log x})$we get $$s(n)=\sum_{p \leq n^{1/3}}\frac{(p-1,n)}{p^2}+O(1)$$ and one can make this more accurate. There is something in the expression$s(n)=\sum_{d|n}\phi(d)a_d$that is linked to Linnik's constant(or the Elliot-Halberstam Conjecture). In particular, using$a_d=\sum_{p=1(mod d), p>y} p^{-2} \leq d^{-2}\sum_{m>y/d}m^{-2}$one can deduce that $$s(n)=\sum_{d|n}\phi(d) a'(d)+O(1)$$ where $$a'(d)=\sum_{p \leq d \log d {\log \log d}^2, p=1(mod d)}\frac{1}{p^2}$$ That seems to suggest that for each n for which$s(n)$is quite large then for many divisors$d|n$there might be many primes$p=1 (mod d)$in the interval$[d,d \log d {\log \log d}^{2}]$and conversely, but I haven't been able to establish a clear connection between these two facts. To this end we may compute the mean values$\sum_{n \leq x} s^{2k}(n), k \geq 0$which is quite straightforward. Does all this set-up reminds you anything I could look up? 2 deleted 3 characters in body A few more ideas: using the chebyshev upper bound in the form$\sum_{p>y}p^{-2} \ll 1/y \log y$we see that$s(n)=\sum_{p \leq \frac{n}{\log n}}\frac{(p-1,n)}{p^2}+O(1).$Furthermore by the equality$\sum_{p \leq x}p^{-1}=\log \log x +A +(\frac{1}{\log x})$we get $$s(n)=\sum_{p \leq n^{1/3}}\frac{(p-1,n)}{p^2}+O(1)$$ and one can make this more accurate. There is something in the expression$s(n)=\sum_{d|n}\phi(d)a_d$that is linked to Linnik's constant(or the Elliot-Halberstam Conjecture). In particular, using$a_d=\sum_{p=1(mod d), p>y} p^{-2} \leq d^{-2}\sum_{m>y/d}m^{-2}$one can deduce that $$s(n)=\sum_{d|n}\phi(d) a'(d)+O(1)$$ where $$a'(d)=\sum_{p \leq d \log d {\log \log d}^2, p=1(mod d)}\frac{1}{p^2}$$ That seems to suggest that for each n such that if for which$s(n)$is quite large then for many divisors$d|n$there might be many primes$p=1 (mod d)$in the interval$[d,d \log d {\log \log d}^{2}]$and conversely, but I haven't been able to establish a clear connection between these two facts. To this end we may compute the mean values$\sum_{n \leq x} s^{2k}(n), k \geq 0$which is quite straightforward. Does all this set-up reminds you anything I could look up? 1 A few more ideas: using the chebyshev upper bound in the form$\sum_{p>y}p^{-2} \ll 1/y \log y$we see that$s(n)=\sum_{p \leq \frac{n}{\log n}}\frac{(p-1,n)}{p^2}+O(1).$Furthermore by the equality$\sum_{p \leq x}p^{-1}=\log \log x +A +(\frac{1}{\log x})$we get $$s(n)=\sum_{p \leq n^{1/3}}\frac{(p-1,n)}{p^2}+O(1)$$ and one can make this more accurate. There is something in the expression$s(n)=\sum_{d|n}\phi(d)a_d$that is linked to Linnik's constant(or the Elliot-Halberstam Conjecture). In particular, using$a_d=\sum_{p=1(mod d), p>y} p^{-2} \leq d^{-2}\sum_{m>y/d}m^{-2}$one can deduce that $$s(n)=\sum_{d|n}\phi(d) a'(d)+O(1)$$ where $$a'(d)=\sum_{p \leq d \log d {\log \log d}^2, p=1(mod d)}\frac{1}{p^2}$$ That seems to suggest that for each n such that if$s(n)$is quite large then for many divisors$d|n$there might be many primes$p=1 (mod d)$in the interval$[d,d \log d {\log \log d}^{2}]$and conversely, but I haven't been able to establish a clear connection between these two facts. To this end we may compute the mean values$\sum_{n \leq x} s^{2k}(n), k \geq 0\$ which is quite straightforward. Does all this set-up reminds you anything I could look up?