Denote $\gcd(a, b)$ as $(a, b)$
Let $$f(a) =\sum_{k=1}^a (k,a)$$
Clearly $f(a)\equiv 1\pmod{a-1}$ if $a$ is prime.
Can it be shown that, there are infinitely many composite numbers satisfied $f(a)\equiv1\pmod{a-1}$?
First four composite numbers are $41124, 230867, 358267, 37539572$.
Formula
$$f(a)=\sum_{d\mid a} d\phi(a/d)$$
Thus $f$ is multiplicative.
We can compute $f(p^n)=np^{n-1}(p-1)+p^n$, when $p$ is prime. Which is a general formula for $f(a)$ in terms of the prime factorization of $a.$
Source Code PARI/GP:
forcomposite(a=2,10^8,s=0;fordiv(a,d,s+=d*eulerphi(a/d));if(s%(a-1)==1,print([a])))
Credit: viper found above four composite number through given code and Thomas Andrews, write a formula for $f(a)$.
This problem is sequel to my MSE post (link).Your suggestions, comments, the answer are very valuable to me. Apologies if the problem is just unsolvable. Thank you.