Skip to content

Are 111, 1111, and 11111 prime?

yuuki edited this page Sep 3, 2025 · 55 revisions

I thought about this in a sauna at a hot spring:

Is 111 prime?

No, it is divisible by 3.

What about 1111?

This looks like a prime. It is not divisible by 3, 5, or 7. But no. It has an amazing factorization: 1111 = 11 101 .

What about 11111? Then I got overheated.

Repunits

A number of the form 11. . .1 is called a repunit. Let R n be the repunit with n ones.

R 4 = 1111 is divisible by R 2 = 11 . If n is even, then R n is divisible by R 2 = 11 .

More generally, if n is composite, then R n is divisible by R k , where k is a factor of n . For example, R 9 = 111 , 111 , 111 is divisible by R 3 = 111 .

Therefore, R n is prime only if n is prime.

R 2 = 11 is prime, but neither R 3 = 111 nor R 5 = 11111 is. The next primes after R 2 are R 19 and R 23 , followed by R 317 .

Repdigits

A number like 111, 222, or 4444 is called a repdigit. Every repunit is a repdigit.

Every repdigit is divisible by a repunit, e.g., 777 = 7 111 , so it is not prime, except for repunit primes and the single-digit primes.

#math