As the name suggested, Concatenated Consecutive Prime is a prime number formed by concatenating consecutive prime numbers. For a given number of constituting primes (defined as "n"), please output a vector containing n consecutive primes that satisfy this problem. There is no unique answer, so your results will be evaluated against the requirements.
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers17
Suggested Problems
-
Find the sum of all the numbers of the input vector
53776 Solvers
-
Back to basics 9 - Indexed References
459 Solvers
-
403 Solvers
-
Sum of first n positive integers
622 Solvers
-
Delete 2nd and 5th column of Given 6*6 matrix
169 Solvers
More from this Author180
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The test suite only seems to work if the n primes each have the same number of digits. For example, with n=3, a perfectly good answer would be [5,7,11], but this crashes the test suite. It could be fixed by using combine=strcat(combine,strtrim(b(i,:)));
@William: your suggestion has been incorporated into the test suite.
Thank you both for improving the quality of this problem. Cheers, Doddy.
Given the limited test suite due to the nature of the question, it can be easily solved by hard-coding.