Problem 52183. List the nth prime quartet prefix
Solution Stats
Problem Comments
-
2 Comments
Nikolaos Nikolaou
on 11 Apr 2023
Nice problem , made me think :)
Augusto Mazzei
on 2 May 2023
Ah! this was a cool opportunity to use a regex in a fair way:
with 'n' input
persistent a
if isempty(a)
primes(27e7);
a=regexp(sprintf('%d.',ans),'(\d+)1\.\13\.\17\.\19\.','match');
end
strsplit(a{n},'.'); str2num(ans{1}(1:end-1))
Solution Comments
Show commentsProblem Recent Solvers8
Suggested Problems
-
Arrange Vector in descending order
9243 Solvers
-
Make a random, non-repeating vector.
7413 Solvers
-
344 Solvers
-
332 Solvers
-
Integer Sequence - II : New Fibonacci
436 Solvers
More from this Author216
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!