27. (ROM 1) Let \( m \) be a positive odd integer, \( m \geq 2 \). Find the smallest positive integer \( n \) such that \( 2^{1989} \) divides \( m^n - 1 \).
27. Let $n$ be the required exponent, and suppose $n=2^{k} q$, where $q$ is an odd integer. Then we have  
$$ m^{n}-1=\left(m^{2^{k}}-1\right)\left[\left(m^{2^{k}(q-1)}+\cdots+m^{2^{k}}+1\right]=\left(m^{2^{k}}-1\right) A\right. $$  
where $A$ is odd. Therefore $m^{n}-1$ and $m^{2^{k}}-1$ are divisible by the same power of 2, and so $n=2^{k}$. Next, we observe that  
$$ \begin{aligned} m^{2^{k}}-1 & =\left(m^{2^{k-1}}-1\right)\left(m^{2^{k-1}}+1\right)=\ldots \\ & =\left(m^{2}-1\right)\left(m^{2}+1\right)\left(m^{4}+1\right) \cdots\left(m^{2^{k-1}}+1\right) \end{aligned} $$  
Let $s$ be the maximal positive integer for which $m \equiv \pm 1\left(\bmod 2^{s}\right)$. Then $m^{2}-1$ is divisible by $2^{s+1}$ and not divisible by $2^{s+2}$. All the numbers $m^{2}+1, m^{4}+1, \ldots, m^{2^{k-1}}+1$ are divisible by 2 and not by 4. Hence $m^{2^{k}}-1$ is divisible by $2^{s+k}$ and not by $2^{s+k+1}$. It follows from the above consideration that the smallest exponent $n$ equals $2^{1989-s}$ if $s \leq 1989$, and $n=1$ if $s>1989$.