0

For the repunits $R_n$, where $R_n={(10^n-1)}/{9}$, verify the assertion.

If $\gcd(n,m)=1$, then $\gcd(R_n,R_m)=1$.

I've been trying to solve this problem, however, every attempt so far has been unsuccessful. I would greatly appreciate any solutions or hints.

3 Answers3

3

HINT: Assume that $m<n$; then $R_n-10^{n-m}R_m=R_{n-m}$, so

$$\gcd(R_m,R_n)=\gcd(R_m,R_{n-m})\;.$$

Mimic the Euclidean algorithm to show that $\gcd(R_m,R_n)=R_{\gcd(m,n)}$.

Brian M. Scott
  • 616,228
  • to mimic the Euclidean algoritm, isn't it necessary that n-m<m? – nomadicmathematician Jan 11 '15 at 16:08
  • @user135204: No: if $n-m>m$, just replace $n$ by $n-m$ and repeat the first step. I’m thinking of the version of the Euclidean algorithm that works by repeated subtraction rather than by division. E.g., $\gcd(13,4)=\gcd(9,4)=\gcd(5,4)=\gcd(1,4)=\gcd(4,1)$. – Brian M. Scott Jan 11 '15 at 16:12
1

Let $a > 1$ be an integer, $m, n, t$ positive integers. One can prove the following facts.

  1. $a^{m} - 1$ divides $a^{n} - 1$ iff $m \mid n$. Thus
  2. $a^{\gcd(m, n)}-1$ divides $\gcd(a^{m} - 1, a^{n} - 1)$. In fact
  3. $a^{\gcd(m, n)}-1 = \gcd(a^{m} - 1, a^{n} - 1)$.

The last point follows from the fact that if $t$ divides both $a^{m} - 1$ and $a^{n} - 1$, then $a^{m} \equiv a^{n} \equiv 1 \pmod{t}$, and a simple application of Bezout shows that $a^{\gcd(m, n)} \equiv 1 \pmod{t}$.

From this it follows that $$ \frac{a^{\gcd(m, n)}-1}{a-1} = \gcd\left(\frac{a^{m} - 1}{a-1}, \frac{a^{n} - 1}{a-1}\right). $$

1

Hint: If $m\geq n$, $$\underbrace{111\ldots 111}_{\color{red}{m} \text{ ones}}\pmod{\underbrace{111\ldots 111}_{\color{red}{n} \text{ ones}}}=\underbrace{111\ldots 111}_{\color{red}{m\!\pmod{\!n}} \text{ ones}}.$$ This gives that, if $A_n$ is the $n$-digits repunit, $$\gcd(A_m,A_n) = \gcd(A_m,A_{m\pmod n}) = \ldots = A_{\gcd(m,n)}. $$

Jack D'Aurizio
  • 353,855