# Units in a Subring of $\mathbb Q$.

I have this question:

Let $n\in \mathbb{Z}$ be a non-zero integer. Let us define: $$\mathbb Z\left[\frac{1}{n}\right] := \left\{\left.\frac{a}{n^r}\, \right\rvert\, a,r\in \mathbb{Z}, r \geq 0\right\}.$$ I want to find all the units in this set.

But I'm not sure how.

I thought of plugging in different values of $n$ but I'm simply stuck.

Can someone give me a hint?

-
Your ring is a suborning of the rational numbers, and it is easy to find the inverse of a rational number. A number will be a unit if its inverse lies in the ring. – Aaron Mar 6 '14 at 5:39
Expanding on Henry's solution, I was just wondering if I could just say that $a$ is some power of $n$. So if that's the case. $\frac{1}{n^{r-t}}$. Call this $r-t = k$. Then the units of are just $3^k$. – user133458 Mar 6 '14 at 5:42
Only when $n$ is prime. Otherwise, a unit will be something whose numerator only has prime factors which also divide $n$ – Aaron Mar 6 '14 at 5:52
Thank you for clarifying! – user133458 Mar 6 '14 at 5:59

It turns out that $\frac{a}{n^r}$ is a unit iff there is a $k \ge 0$ such that $a \mid n^k$.
Consider $\frac{a}{n^r}$ a unit. There must be a $\frac{b}{n^s}$ such that $\frac{a}{n^r} \cdot \frac{b}{n^s} = 1$. This implies that $n^{r + s} = ab$, and so $a$ divides some power of $n$.
Let $a$ divide some power of $n$, so for some $c$ and $k$, we have $ac = n^k$. Then $a \cdot \frac{c}{n^k} = 1$, so $a$ is a unit. So this necessary condition is also sufficient.
Hey. I was wondering if I could just say that $a$ is some power of $n$. So if that's the case. $\frac{1}{n^{r-t}}$. Call this $r-t = k$. Then the units of are just $3^k$ – user133458 Mar 6 '14 at 5:40
If $n$ is prime, then the only way for $a$ to divide a power of $n$ is for $a$ to be an $n$-power itself (including $n^0 = 1$). But if $n = 6$, $a = 3$ is a unit, even though it is not a power of $6$. – Henry Swanson Mar 6 '14 at 5:53
Thanks for the explanation! If that's the case, the only units in this subring would be only $+a$ and $-a$? – user133458 Mar 6 '14 at 6:00
Any $a$ that divides a power of $n$ is a unit, positive or negative. Another way of phrasing this criterion is: all prime factors of $a$ are also factors of $n$. (Here, $1$ has no prime factors, so it is vacuously true in that case) – Henry Swanson Mar 6 '14 at 7:47