Each of p and q is a
prime number and each of x and y is a
positive integer, with x greater than 1.
Find quadruplet(s) (p, q, x, y) that satisfy this equation:
px - qx = 2y
providing adequate reasons as to why there are no further solutions.
*** Adapted from a problem which appeared at the Brazilian Mathematical Olympiad in 1997.
p=sym.empty; clc
for x=1:25
p(x,:)=sym(primes(sym(nthprime(sym(60))))).^sym(x);
end
for x=2:8
for qNo=1:60
for pNo=qNo+1:60
p2=p(x,pNo)-p(x,qNo);
y=eval(log(sym(p2))/log(sym(2)));
if y==round(y)
disp([p(1,pNo),p(1,qNo),x,y])
end
end
end
end
tests x from 1 to 8 and p and q through the 60th prime (281).
It finds only [5, 3, 2, 4], that is
5^2 - 3^2 = 2^4
|
Posted by Charlie
on 2022-06-06 08:08:37 |