4

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
    Fermat's little theorem guarantees $$10^{p-1}\equiv 1\mod p$$ for every prime $p$ coprime to $10$, hence $p\mid 10^{p-1}-1$ holds for every prime $p$ coprime to $10$, hence the answer is "no". This can be extended to every number $n$ coprime to $10$ by using Euler's theorem which guarantees $$n\mid 10^{\varphi(n)}-1$$ where $\varphi(n)$ denotes the totient-function. – Peter Sep 17 '18 at 10:53
  • 4
    You know, @Peter , I wanted to make this question a question that everyone can try it (and not "accidentally" seeing the answer) – Vee Hua Zhi Sep 17 '18 at 11:01
  • 1
    I appreciate this being set as a challenge :) – Mr Pie Sep 17 '18 at 11:05
  • So you do not really have a question, but you want collect approaches for this exercise ? Why didn't you that point out clearer ? – Peter Sep 17 '18 at 11:08
  • @user477343 But I have doubts that this site is suitable for this purpose. puzzleexchange (if I remember the name right) would probably be a better choice. – Peter Sep 17 '18 at 11:09
  • 1
    That is for puzzles, not math, right? – Vee Hua Zhi Sep 17 '18 at 11:10
  • 1
    related: https://math.stackexchange.com/questions/1009511/primes-dividing-11-111-1111 – farruhota Sep 17 '18 at 11:11
  • Considering the name, it is for puzzles or challanges. So, you might migrate the question to this site. – Peter Sep 17 '18 at 11:11
  • I doubt they deal with modular arithmetics – Vee Hua Zhi Sep 17 '18 at 11:11
  • @farruhota ( ´Д`)That's a spoiler – Vee Hua Zhi Sep 17 '18 at 11:13
  • 1
    @Peter there is a very old Math.SE post, one of the first posts actually, that says it is allowed to post such challenges. I'll find it :) – Mr Pie Sep 17 '18 at 11:19
  • 3
    Peter does have a point, but puzzles on that site can range from mathematics to all sorts of things. It is just that these kind of "challenge" posts are not very common on this site, but if you want, you can follow Math Challenges. There is an old 2010 or 2014 post, I think, that does state the rules of Math.SE, but I am not too sure if they have stuck up to now. I am currently looking for it :D – Mr Pie Sep 17 '18 at 11:23
  • 1
    @Peter It should be somewhere here, perhaps. Still looking :) – Mr Pie Sep 17 '18 at 11:25
  • I suppose the checkbox (under the "Ask Your Question" section) with "Answer your own question – share your knowledge, Q&A-style" should mean this. – Vee Hua Zhi Sep 17 '18 at 11:32
  • This is related to the decimal expansion of the fraction $\frac{1}{p}$ being periodic. As an example, we have $$\frac{1}{13} = 0.076923\ 076923\ 076923\ \ldots$$ so that $$\frac{1}{13} = \frac{76923}{999999}$$ from which $999999 = 13\cdot 76923$. – Jeppe Stig Nielsen Sep 17 '18 at 11:37

2 Answers2

5

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$.

Mr. Brooks
  • 1,098
2

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.