Consider the integers modulo $m$, for composite $m$. Then an element $x$ only has a multiplicative inverse if it is relatively prime to $m$. Therefore, it is possible to have a set of more than one element, so that no element in the set can be written as a linear combination of the others; call such a set linearly independent. For example, $\{2,3\}$ is linearly independent mod 6.

What is the largest size of a maximum independent subset of the integers mod $m$, for arbitrary $m$? Can this be expressed in terms of the factors of $m$?

Conversely, given an arbitrary set $S \subseteq \mathbb{Z}/m\mathbb{Z}$, can we give an upper bound on the size of a smallest spanning subset $S'$ of $S$ in terms of the factors of $m$?

(Apologies if this question is too elementary; it came up in research in algorithm design.)