Determine all possible values of a prime number p, such that:
p2-p+1 is a perfect cube.
p=primes(99999999);
for i=1:length(p)
c=p(i)^2-p(i)+1;
cr=round(c^(1/3));
if cr^3==c
disp([p(i) c cr])
end
end
tests all primes below 100 million and finds only p = 19, p^2 - p + 1 = 343, which is 7^3.
|
Posted by Charlie
on 2023-10-24 08:49:46 |