I tried to understand this answer.
However, I do not understand how the sets $A(d) = \{k \in S :(k,n) = d\}$, $S = \{1,2,...,n\}$ are disjoint and that their cardinality sums up exactly to $n$, since for example $n = 8$, then the divisors are ${8,4,2,1}$, so:
$$A(8) =\{8\}$$ $$A(4)=\{4\}$$ $$A(2)=\{6,2\}$$ $$A(1)=\{1,3,5,7\}$$
And we easily see that: $|A(8)| + |A(4)| + |A(2)| + |A(1)| = 8$.
However how to show this for a general number ?
(I know that some proofs are with cyclic generators, but In classes we didn't take that subject).
Is there a more elementary way to show this ?
I understand what every element of $A(d)$ is, but why does it cover all $S$ ?
– VLC Dec 30 '21 at 18:59