Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was thinking of decimal expressions for fractions, and figured that a fraction of the form $\frac{1}{p}$ must be expressed as a repeating decimal if $p$ doesn't divide $100$. Thus, $\frac{p}{p}$ in decimal would equal $0.\overline{999\dots}$ for some number of $9$s, thus there must be some amount of $9$s such that $p | 999...$ in order for a decimal representation of $\frac{1}{p}$ to be possible.

Furthermore, the question could be rephrased to "an infinite number of" since if it divides $999\dots$ where there are $k$ nines, it also divides when there are $2k, 3k, \dots$ nines.

Is this reasoning correct? If so, this is how I thought about proving it:

We can reduce the set to $\{1, 11, 111, 1111, \dots\}$ since $p=3$ obviously works.

Let $a_k = 111\dots$ where there are $k$ ones. This satisfies the recursion $a_k = 10a_{k-1} + 1$

But I'm unsure what to do past this point (tried looking at modular cases or something but wasn't able to get anywhere). Am I on the right track at all? Is this "conjecture" even correct?

share|cite|improve this question

marked as duplicate by Micah, Rebecca J. Stones, GEdgar, Lost1, Nick Peterson Feb 6 '14 at 2:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 11 down vote accepted

$$ 10^{p-1} \equiv 1 \pmod p $$

share|cite|improve this answer
Oh right! I forgot Fermat's little theorem. It seems reducing the set to $\{1, 11, \dots\}$ put me on the wrong track! – Michael Tong Feb 6 '14 at 2:05

Essentially, you wish to find a $k$ such that $10^k - 1 \equiv 0 \pmod p$. This is equivalent to $10^k \equiv 1 \pmod p$. There are many reasons that such a $k$ exists: (for $p \ne 2,5$), but I'd argue the cleanest one is this:

  • $\mathbb{Z}_p$ is a field, and so $(\mathbb{Z}_p)^\times$ is a group under multiplication. Since the group is finite, $10$ has finite order.
share|cite|improve this answer

Even without knowledge of little Fermat you can solve this. By the pigeonhole (box) principle, the map $\rm\:k\mapsto 10^k\ (mod\ n)\:$ from $\,\Bbb N\,$ to $\rm\,\Bbb Z/n\Bbb Z\:$ is not $1$-$1,$ therefore there exist naturals $\rm\:j\!+\!k > j\:$ such that $\rm\: 10^{\,j+k}\equiv\,10^{\,j}\ (mod\ n),\ $ i.e. $\rm\ n\:|\:10^j(10^k-1).$ Thus $\,(n,10)=1\,\Rightarrow\,n\mid 10^k-1\,$ follows by Euclid's Lemma.

share|cite|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.