for p1=1:200
for p2=1:200
p=nthprime(p1);
q=nthprime(p2);
sq=p^2+5*p*q+4*q^2;
sr=sqrt(sq);
if round(sr)*round(sr)==sq
disp([nthprime(p1) nthprime(p2) sq sr])
end
end
end
finds only
p q p^2+5*p*q+4*q^2 square
root
5 11 784 28
7 5 324 18
13 3 400 20
having checked primes up to the 200th, 1223.
|
Posted by Charlie
on 2020-12-06 15:37:26 |