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. :-)
Size world record ?
circul -ez y a rien à voir :)
Find the sum of all the numbers of the input vector
Back and Forth Rows
2 b | ~ 2 b
"Low : High - Low : High - Turn around " -- Create a subindices vector
Is it an Armstrong number?
The Hills Are Alive...
I'm going to enjoy watching you calculate, Mr Anderson
Pseudo Square Root (Inspired by Project Euler 266)
Pandigital Factors (Based on Euler 491)
A (wrong) place for everything, and everything in its (wrong) place
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office