Problem 1095. Circular Primes (based on Project Euler, problem 35)
Solution Stats
Problem Comments
-
5 Comments
Very nice problem!
How do you return two separable outputs via a single vector?
Christopher, I should have been more clear in the problem description.
There are two outputs to the function. The first output (how_many) is a scalar, and is the number of circular primes.
The second output (what_numbers) is the vector containing the values of the circular primes.
Does this help?
197 is not circular prime, because neither 791 nor 917 are themselves prime. Only test case 2 is correct.
Christopher, if our number is represented as ABC, then a cicrular prime is a number where ABC, BCA, and CAB are all prime. You are either shifting the numbers in the opposite direction or scrambling them. Not every permutation of the numbers has to be a prime number, although that in itself would be an interesting Cody problem. :-)
Solution Comments
-
1 Comment
Size world record ?
-
1 Comment
circul -ez y a rien à voir :)
Problem Recent Solvers284
Suggested Problems
-
What is the next step in Conway's Life?
1023 Solvers
-
6534 Solvers
-
Create matrix of replicated elements
342 Solvers
-
Number of digits in an integer
383 Solvers
-
5441 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!