A sequence consisting of prime numbers only starts with 2, the first prime. The next term is the smallest unused prime that shares a digit with the previous term. Therefore, the first few terms of the sequence are 2, 23, 3, 13, 11, 17, 7, 37, 31, 19, 29, 59,…
Write a function to compute the first n terms of the sequence.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers3
Suggested Problems
-
Shuffle primes based on their digits
3 Solvers
More from this Author326
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!