Cody

Problem 1215. Diophantine Equations (Inspired by Project Euler, problem 66)

Solution 1938675

Submitted on 16 Sep 2019 by Augusto Mazzei
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   Pass
x = 2; y_correct = 3; assert(isequal(Diophantine(x),y_correct))

Possible Solution (?) D: 2, x: 3, y 2

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

Possible Solution (?) D: 151, x: 498062163, y 40531724 imSorry = 1.0e+13 * 0.0002 0.0002 1.3008 0.0000 verySorry = 1.7281e+09

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

Possible Solution (?) D: 61, x: 335159612, y 42912791 imSorry = 1.0e+13 * 0.0002 0.0002 1.3008 0.0000 verySorry = 1.7663e+09

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

Possible Solution (?) D: 66, x: 65, y 8

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

Possible Solution (?) D: 12000, x: 1954527133, y 17842310 imSorry = 1.0e+13 * 0.0002 0.0002 1.3008 0.0000 verySorry = 1.3008e+13

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

Possible Solution (?) D: 2345, x: 15129001, y 312420

7   Pass
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)))

Possible Solution (?) D: 10, x: 19, y 6Possible Solution (?) D: 20, x: 9, y 2Possible Solution (?) D: 30, x: 11, y 2Possible Solution (?) D: 40, x: 19, y 3Possible Solution (?) D: 50, x: 99, y 14Possible Solution (?) D: 60, x: 31, y 4Possible Solution (?) D: 70, x: 251, y 30Possible Solution (?) D: 80, x: 9, y 1Possible Solution (?) D: 90, x: 19, y 2Possible Solution (?) D: 110, x: 21, y 2Possible Solution (?) D: 120, x: 11, y 1Possible Solution (?) D: 130, x: 6499, y 570Possible Solution (?) D: 140, x: 71, y 6Possible Solution (?) D: 150, x: 49, y 4Possible Solution (?) D: 160, x: 721, y 57Possible Solution (?) D: 170, x: 339, y 26Possible Solution (?) D: 180, x: 161, y 12Possible Solution (?) D: 190, x: 52021, y 3774Possible Solution (?) D: 200, x: 99, y 7

Suggested Problems

More from this Author80

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!