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
-
110 Solvers
-
Project Euler: Problem 6, Natural numbers, squares and sums.
1893 Solvers
-
Project Euler: Problem 9, Pythagorean numbers
996 Solvers
-
448 Solvers
-
Calculate the derivative of a polynomial
221 Solvers
More from this Author219
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!