Interesting sequence in size of coprime equivalence classes In the course of computation for a Project Euler problem, I was testing a function and noticed a strange pattern.
Take the natural numbers $\{2 , 3 , \dots n\}$. Call $a \sim b$ iff all natural numbers coprime to $a$ are also coprime to $b$ and vice-versa. This is the same as saying that they have the same prime factorisation if we ignore the exponents.
Call $f(n)$ the number of equivalence classes
$$f(n) = \left|(\{2,3,\dots n\}/\sim) \right|$$
Example for n = 10: The equivalence classes are $\{\{2,4,8\},\{3,9\},\{6\},\{5\},\{7\},\{10\}\}$
Example for n = 20: The equivalence classes are $\{\{2,4,8,16\},\{3,9\},\{6,12,18\},\{5\},\{10,20\},\{7\},\{11\},\{13\},\{14\},\{15\},\{17\},\{19\}\}$
Here are some sample values for $f$ for powers of $10$:
$$\begin{align}
f(10) &= 6 \\
f(100) &= 60 \\
f(1000) &= 607 \\
f(10000) &= 6082 \\
f(100000) &= 60793 \\
f(1000000) &= 607925
\end{align}$$
Call me superstitious, but this looks like a pattern. In fact, it looks like the decimal expansion of $6/\pi^2$.

Does anyone know if there's a genuine pattern here, and why?

The answer by @BoltonBailey explains it very well. I'll just add some trivial details about the computation. In fact, $n$ is square-free iff $\mu(n)\not=0$, i.e., $(\mu(n))^2=1$. So $f(n)/n$ evaluates to
\begin{align}\frac{f(n)}n & =\frac 1 n \sum_{i\leq n}(\mu(i))^2\\
& = \frac 1 n\sum_{i\leq n}\sum_{d^2\mid i}\mu(d)\\
& =\frac 1 n\sum_{d\leq\sqrt n}\mu(d)\left(\frac{n}{d^2}+O(1)\right)\\
& =\sum_{d\leq\sqrt n}\frac{\mu(d)}{d^2}+O(n^{-1/2})\\
& =\frac 1 {\zeta(2)}+O(n^{-1/2})\end{align}
