Divisibility of $10^n-1$

951 Views Asked by At

Quick warm-up exercise for everyone (no spoilers for the others please) ;)

A number of the form $10^n-1=\underbrace{9999...9}_{n\text{ times}},$ where $n$ is a positive integer, will never be divisible by $2$ or $5.$

Are there any other prime numbers that numbers of this form are never divisible by?

Note: I appreciate all solutions and I will vote up to the answers that use a different approach than mine :)

Update: If you consider this a challenge, PLEASE don't read the comments.

2

There are 2 best solutions below

1
On BEST ANSWER

In general, given an integer base $b \geq 2$, the number $b^n - 1$, with $n$ a positive integer, is never divisible by any prime $p$ that divides $b$.

However, for any other prime $p$, by Fermat's little theorem, if $n$ is a multiple of $p - 1$, then $b^{p - 1} - 1$ is divisible by $p$. Also, all these numbers are divisible by $b - 1$.

For example, in duodecimal, we see that $12^n - 1$ is never divisible by $2$ or $3$. However, $12^4 - 1 = 20735$, $12^8 - 1 = 429981695$, $12^{12} - 1 = 8916100448255$, etc., are all divisible by $5$; $12^6 - 1 = 2985983$, $12^{12} - 1 = 8916100448255$, etc., are all divisible by $7$. Also we see that all these numbers are divisible by $11$, they are written as a bunch of $\textrm{B}$'s, or $\textrm{b}$ if you prefer.

Similarly in hexadecimal you will see that all numbers of the form $16^n - 1$ (which in binary are represented by $4n$ on bits) are divisible by $15$.

0
On

No.


By Fermat's Little Theorem, if $p$ is a prime that doesn't divide $10,$ then $$p \text{ divides } 10^{p-1} - 1$$

The proof follows.