The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.

There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.

Given a number x, write a MATLAB script that will tell you the number of circular primes less than or equal to x as well as a sorted list of what the circular prime numbers are.

Solution Stats

2229 Solutions

649 Solvers

Last Solution submitted on Jan 26, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers649

Suggested Problems

More from this Author80

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!