Recurrent server error message while submitting solution for a given problem in Cody
Show older comments
Hi,
When I test it in the scratch pad, all the tests run successfully.
However, when I try to submit it -since the begining of the week now- I get the recurrent server error message :
"The server is not available. Wait a few minutes, and then retry your request. If the problem persists, contact the instructor."
Could you please help ?
Thank you
My solution by the way (even it may not be perfect, I don't see any reason it would come from here ?) :
function [pp,a,b] = PythagoreanPrime(n)
u = [];
k = 5;
while numel(u) < n
[r,a,b] = isPythagoreanPrime(k);
if r
u = cat(2,u,k);
end
k = k + 2;
end
pp = u(end);
end
function [r,a,b] = isPythagoreanPrime(p)
r = (mod(p-1,4) == 0) & isprime(p);
if r
k = 1;
while k < floor(0.5*p)
c = [k,p-k];
if sum(floor(sqrt(c)) == sqrt(c),2) == 2
a = sqrt(k);
b = sqrt(p-k);
break;
end
k = k + 1;
end
else
a = [];
b = [];
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!