Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Ascending-primes/MATLAB/ascending-primes.m
Normal file
14
Task/Ascending-primes/MATLAB/ascending-primes.m
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
queue = 1:9;
|
||||
|
||||
j = 1;
|
||||
while j < length(queue)
|
||||
n = queue(j);
|
||||
j = j + 1;
|
||||
a = n * 10 + mod(n, 10) + 1;
|
||||
b = n * 10 + 9;
|
||||
if a <= b
|
||||
queue = [queue, a:b];
|
||||
end
|
||||
end
|
||||
|
||||
queue(isprime(queue))
|
||||
Loading…
Add table
Add a link
Reference in a new issue