-
Notifications
You must be signed in to change notification settings - Fork 0
Are 111, 1111, and 11111 prime?
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 a factorization:
What about 11111? Then I got overheated.
Later, I became interested in palindromes in language, which led me to study numbers as strings in math.
Examples | Name | Prime only if | OEIS | Regex |
---|---|---|---|---|
11, 111, 1111 | repunit |
|
A002275 | 1+ |
111, 222, 3333 | repdigit | repunit[^1] | A010785 | (.)\1* |
123, 234, 5678 | A138141 | |||
121, 1221, 12321 | palindromic number | length is odd[^2] | A002113 | |
101, 1001, 10001 | of the form |
A000533 | 10*1 |
A number of the form
If
Therefore,
A number like 111, 222, or 3333 is called a repdigit. Every repunit is a repdigit.
Repdigits are not prime (except for repunit primes and single-digit primes) because they are divisible by a repunit, e.g.,
[^1]: Except single-digit primes.
[^2]: Except 11.
🧸 Content is available under CC BY-SA 4.0 unless otherwise noted.