Cody

Solution 1972025

Submitted on 11 Oct 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = 2; y_correct = 3; assert(isequal(Diophantine(x),y_correct))

y = 1.7321

Assertion failed.

2   Fail
x = 151; y_correct = 1728148040; assert(isequal(Diophantine(x),y_correct))

y = 12.3288

Assertion failed.

3   Fail
x = 61; y_correct = 1766319049; assert(isequal(Diophantine(x),y_correct))

y = 7.8740

Assertion failed.

4   Fail
x = 66; y_correct = 65; assert(isequal(Diophantine(x),y_correct))

y = 8.1854

Assertion failed.

5   Fail
x = 12000; y_correct = 13007560326001; assert(isequal(Diophantine(x),y_correct))

y = 109.5491

Assertion failed.

6   Fail
x = 2345; y_correct = 15129001; assert(isequal(Diophantine(x),y_correct))

y = 48.4355

Assertion failed.

7   Fail
j=[10:10:90 110:10:200]; v=arrayfun(@(x) Diophantine(j(x)),1:length(j)); y_correct=[19 9 11 19 99 31 251 9 19 21 11 6499 71 49 721 339 161 52021 99]; assert(all(isequal(v,y_correct)))

y = 3.3166 y = 4.5826 y = 5.5678 y = 6.4031 y = 7.1414 y = 7.8102 y = 8.4261 y = 9 y = 9.5394 y = 10.5357 y = 11 y = 11.4455 y = 11.8743 y = 12.2882 y = 12.6886 y = 13.0767 y = 13.4536 y = 13.8203 y = 14.1774

Assertion failed.