How many numbers $n$ are there such that $\gcd(n,\phi(n)) = 1$

asymptoticsdivisibilitynumber theoryprime numbers

Let $f(x)$ be the number of such natural numbers $n \le x$ such that $\gcd(n,\phi(n)) = 1$. Since $\phi(n)$ is even for $n \ge 3$, hence apart from $1$ and the trivial set of primes, all numbers with the above property must be square free odd composites. But not all square free composites have this property e.g. the number $21$ is an exception. The sequence of odd composite numbers with this property are $15, 33, 35,51,65,69,77, 85,87, 91, 95, \ldots$

My calculations for $x = 6.5 \times 10^9$ suggests that

$$
0.23223 < \frac{f(x)}{x} < 0.27863
$$

Question: What is known about the asymptotics of $f(x)$?

Related question: A conjecture on numbers coprime to its Euler's totient function

Best Answer

These numbers are tabulated at the Online Encyclopedia of Integer Sequences. It says, Erdős proved that $a(n) \sim e^{\gamma} n \log \log \log n$ (where $a(n)$ is the $n$th such number). The reference may be Paul Erdős, Some asymptotic formulas in number theory, J. Indian Math. Soc. (N.S.) 12 (1948) 75-78.