# Thread: Prove prime p divides infinitely many members of 1, 11, 111, 1111...

1. ## Prove prime p divides infinitely many members of 1, 11, 111, 1111...

Prove that if p is prime and p > 5, then infinitely many members of the sequence 1, 11, 111, 1111, ... are divisible by p.

I think I can do most of it. Since p > 5, I used Fermat's little theorem to show 10^(p-1) - 1 ≡ 0 mod p. Then 99...99 ≡ 0 mod p (p-1 nines), which means 11...11 ≡ 0 mod p (p-1 ones) since p > 5 so gcd(p,9) = 1.

That shows one member of the sequence is divisible by p, but how do I go from here to show there are infinitely many?

2. I think the rest is indeed easy. Let m = 11...11 (p-1 ones). Suppose n = 11...11 ≡ 0 (mod p). Then 10^(p-1) * n + m ≡ 0 (mod p).

3. Originally Posted by uberbandgeek6
Prove that if p is prime and p > 5, then infinitely many members of the sequence 1, 11, 111, 1111, ... are divisible by p.

I think I can do most of it. Since p > 5, I used Fermat's little theorem to show 10^(p-1) - 1 ≡ 0 mod p. Then 99...99 ≡ 0 mod p (p-1 nines), which means 11...11 ≡ 0 mod p (p-1 ones) since p > 5 so gcd(p,9) = 1.

That shows one member of the sequence is divisible by p, but how do I go from here to show there are infinitely many?
You actually did most of it...

Note that the numbers $9, 99, 999, ...$ are exactly the numbers of the form $10^k-1$, where $k$ is a positive integer.
As you've pointed out the $(p-1)th$ member in the sequence is divisible by $p$.

But what about any $k$th member, where $k$ is a multiple of $p-1$?

We see that $10^k\equiv1\pmod p$ since $p-1$ divides $k$ and so $10^k-1\equiv0\pmod p$. Lastly, since $(9,p)=1$ we may divide by $9$ to get $(10^k-1)/9\equiv0\pmod p$.

It works for every prime $p$ not equal to $2$ or $5$.