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
-
255 Solvers
-
Back to basics 20 - singleton dimensions
265 Solvers
-
Sum of diagonal of a square matrix
1504 Solvers
-
388 Solvers
-
Numbers spiral diagonals (Part 2)
117 Solvers
More from this Author207
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!