Mathwords logoMathwords

Circular Prime — Definition, Formula & Examples

A circular prime is a prime number that stays prime no matter how you rotate its digits. For example, 197 is a circular prime because 197, 971, and 719 are all prime.

A prime number pp with nn digits d1d2dnd_1 d_2 \dots d_n is called a circular prime if every cyclic permutation of its digits — d2d3dnd1d_2 d_3 \dots d_n d_1, d3d4dnd1d2d_3 d_4 \dots d_n d_1 d_2, and so on — also forms a prime number.

How It Works

To check whether a prime is circular, write out all of its digit rotations and test each one for primality. A number with nn digits produces nn rotations (including the original). If every rotation is prime, the number is a circular prime. Single-digit primes 2, 3, 5, and 7 are automatically circular since they have only one rotation. For multi-digit circular primes, notice that no digit can be even or 5, because at least one rotation would end in that digit and be divisible by 2 or 5. So every multi-digit circular prime uses only the digits 1, 3, 7, and 9.

Worked Example

Problem: Determine whether 131 is a circular prime.
Step 1: List all cyclic rotations of the digits 1, 3, 1.
131,  311,  113131, \; 311, \; 113
Step 2: Check if 131 is prime. It is not divisible by 2, 3, 5, 7, or 11, so 131 is prime.
Step 3: Check 311: not divisible by 2, 3, 5, 7, 11, 13, or 17, so 311 is prime. Check 113: not divisible by 2, 3, 5, 7, or 10, so 113 is prime.
Answer: All three rotations (131, 311, 113) are prime, so 131 is a circular prime.

Why It Matters

Circular primes appear in recreational mathematics and number theory competitions, making them a favorite topic in math olympiad prep. Studying them strengthens your skills in primality testing and divisibility rules, which are foundational for cryptography and computer science.

Common Mistakes

Mistake: Confusing digit rotations with digit rearrangements (permutations).
Correction: Circular primes only require cyclic rotations — moving the first digit to the end each time — not all possible rearrangements. For instance, 197 requires checking 197, 971, and 719, but not 179, 917, or 791.