Cody

# Problem 1095. Circular Primes (based on Project Euler, problem 35)

Solution 2836701

Submitted on 14 Aug 2020 by Alexander
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
[y numbers]=circular_prime(197) assert(isequal(y,16)&&isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197]))

p = 2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 q = 16 y = 16 numbers = 2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197

2   Pass
[y numbers]=circular_prime(100) assert(isequal(y,13)&&isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97]))

p = 2 3 5 7 11 13 17 31 37 71 73 79 97 q = 13 y = 13 numbers = 2 3 5 7 11 13 17 31 37 71 73 79 97

3   Pass
[y numbers]=circular_prime(250) assert(isequal(y,17)&&isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199]))

p = 2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 q = 17 y = 17 numbers = 2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199

4   Pass
[y numbers]=circular_prime(2000) assert(isequal(y,27)&&isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 311 337 373 719 733 919 971 991 1193 1931]))

p = Columns 1 through 14 2 3 5 7 11 13 17 31 37 71 73 79 97 113 Columns 15 through 27 131 197 199 311 337 373 719 733 919 971 991 1193 1931 q = 27 y = 27 numbers = Columns 1 through 14 2 3 5 7 11 13 17 31 37 71 73 79 97 113 Columns 15 through 27 131 197 199 311 337 373 719 733 919 971 991 1193 1931

5   Pass
[y numbers]=circular_prime(10000) assert(isequal(y,33)&&isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 3779 7793 7937 9311 9377]))

p = Columns 1 through 14 2 3 5 7 11 13 17 31 37 71 73 79 97 113 Columns 15 through 28 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 Columns 29 through 33 3779 7793 7937 9311 9377 q = 33 y = 33 numbers = Columns 1 through 14 2 3 5 7 11 13 17 31 37 71 73 79 97 113 Columns 15 through 28 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 Columns 29 through 33 3779 7793 7937 9311 9377

6   Pass
[y numbers]=circular_prime(54321) assert(isequal(y,38)&&isequal(numbers,[2 3 5 7 11 13 17 31 37 71 73 79 97 113 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 3779 7793 7937 9311 9377 11939 19391 19937 37199 39119]))

p = Columns 1 through 14 2 3 5 7 11 13 17 31 37 71 73 79 97 113 Columns 15 through 28 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 Columns 29 through 38 3779 7793 7937 9311 9377 11939 19391 19937 37199 39119 q = 38 y = 38 numbers = Columns 1 through 14 2 3 5 7 11 13 17 31 37 71 73 79 97 113 Columns 15 through 28 131 197 199 311 337 373 719 733 919 971 991 1193 1931 3119 Columns 29 through 38 3779 7793 7937 9311 9377 11939 19391 19937 37199 39119

### Community Treasure Hunt

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

Start Hunting!