A long time ago I've seen a paper considering, given $\ell$ fixed, estimates for


$$
\sum\_{n \leq x, (n, \ell) = 1} 1
$$


Of course, this is easy to estimate with a trivial error term of $O(\varphi(l))$. However in the paper I am looking for the authors
attempted obtaining better bounds, using some Fourier analysis (in particular the Fourier series for the fractional part of x). I think, bounds in the sum


$$
\sum\_{n \leq x} (n, \ell)
$$
are essentially an equivalent variation of the problem, so references on this problem are welcome aswell.


The reason why I am interested in this problem is ... pure curiosity. I am curious to see how the Fourier methods meshed in, and what kind of bounds they gave, even though of course we cannot really expect anything too fantastic in this problem. 



Number of integers coprime to l
It is easy to explain "how the Fourier analysis meshed in". Namely, using the standard notation for the Möbius function, the Euler's totient function, and the integer / fractional part functions, your sum can be written as
 $$ \sum\_{n\le x} \sum\_{d\mid(n,l)} \mu(d) = \sum\_{d\mid l} \mu(d) \lfloor x/d \rfloor
 = x \sum\_{d\mid l} \frac{\mu(d)}d + R = \frac{\phi(l)}lx + R, $$
where 
 $$ R = \sum\_{d\mid l} \mu(d) \{x/d\}. $$
As Fedor Petrov observed, this already suffices to improve the remainder term from $\phi(l)$ to $\tau(l)$ and indeed, to the number of square-free divisors of $l$, which is $2^{\omega(l)}$. To get better estimates, one can try to plug in the Fourier expansion for $\{x/d\}$ and estimate the resulting sums.




---


As to the paper you mention, I think I was able to spot it out: is it "Extremal values of $\Delta(x,N)=\sum\_{n<xN,(n,N)=1} 1-x\phi(N)$" by P. Codeca and M. Nair, published in *Canad. Math. Bull.* **41** (3) (1998), pp. 335–347? Another paper by the same authors on the same subject: "Links between $\Delta(x,N)=\sum\_{n<xN,(n,N)=1} 1-x\phi(N)$ and character sums", *Boll. Unione Mat. Ital. Sez. B Artic. Ric. Mat.* **6** (2) (2003), pp. 509–516. I could find one more paper on this problem published in a Canadian journal: "The distribution of totatives" by D.H. Lehmer,
*Canad. J. Math.* **7** (1955), pp. 347–357.


