<s>[INST] Estimating the number of integers relatively prime to $6$ between $1$ and some integer $x$? I am trying to understand the standard way to estimate the number of integers relatively prime to $6$ where we don't know which congruence class $x$ belongs to.
For a given $x$, if we know the congruence class, it is straight forward to determine the number of integers between $1$ and $x$ that are relatively prime to $6$. 
If $x \equiv  0 \pmod 3$, the answer is $\frac{x}{3}$: i.e., between $1$ and $9$, there are $3$ that are relatively prime:  $\{ 1, 5, 7\}$
If $x \equiv 1 \pmod 6$, the answer is $\frac{x+2}{3}$: ie., between $1$ and $7$, there are $3$.
If $x \equiv 2 \pmod 3$, the answer is $\frac{x+1}{3}$
if $x \equiv 4 \pmod 6$, the answer is $\frac{x-1}{3}$
What be the standard answer for $x$ where we don't know the congruence class?  
Would we say between $\frac{x-1}{3}$ and $\frac{x+2}{3}$?
What would be the right way for any $x$ to estimate the number of integers relatively prime to $6$?
 [/INST] The number of integers relatively prime to $6$ for each $x$ is given by the expression
$$\left\lfloor \frac{x-1}{6}\right\rfloor +\left\lfloor \frac{x+1}{6}\right\rfloor +1$$
which is clearly $\sim x/3.$
Check:
rp6[x_] := Floor[(x - 1)/6] + Floor[(x + 1)/6] + 1

{Length@Select[Range@#, GCD[#, 6] == 1 &] & /@ Range@40, 
rp6@# & /@ Range@40} // ListLinePlot

Generalisation:
The number of integers relatively prime to $n$ for each $x$ is $\sim x \cdot \phi(n)/n,$ where $\phi$ is the Euler totient function.
</s>