Determine all possible triplets (x,y,n) of positive integers, with n>1, that satisfy this equation:
xn - yn = 2015
(In reply to
re: computer findings by K Sengupta)
clearvars,clc
for n=3:5
for y0=1:10000
y=sym(y0);
x=(y^n+2015)^sym(1/n);
if abs(x-round(x))<.0000000000001
if x^n-y^n==2015
disp([x y n]);
end
end
end
end
finds
[14, 9, 3]
14^3 - 9^3 = 2015
Some spurious results follow that, for the fifth power, as the large numbers, even with the extended precision, lead the "close enough" margin to include incorrect results.
Further debugging on the original program shows that while I allowed latitude when determining the solution, I didn't use the integral value in checking the solution. It should have been
clearvars,clc
for n=2:5
for y=1:1000000
x=(y^n+2015)^(1/n);
if abs(x-round(x))<.0000000000001
if round(x)^n-y^n==2015
disp([x y n]);
end
end
end
end
The tiny, allowable due to rounding error, fractional part of x prevented the match to 2015.
|
Posted by Charlie
on 2022-12-18 16:35:23 |