Let p^2-p+1 = x^2, where x is a positive integer.
=> p^2-p=x^3-1
=> p(p-1) =(x-1)(x^2+x+1)
Case 1: p|x-1
Then, x^2+x+1 | p-1
p ≤ x-1 & x^2+x+1 ≤ p-1
Therefore, x^2+x+2≤p≤x-1
=> x^2+x+3 ≤0
No solution.
Case 2: p|x^2+x+1
Let x^2+x+1 = a*p for some positive integer n.
Then, a(x-1) = p-1
=> a(a(x-1)+1) = x^2+x+1
=> a(ax-a+1) = x^2+x+1
=> a^2*x -a^2+a = x^2+x+1
Therefore, we must have:
x^2 +(1-a^2)*x +(a^2-a+1)=0
Then, the discriminant must be a perfect square, so that:
(1-a^2)^2-4(a^2-a+1) = perfect square.
=> a^4 -6a^2+4a -3 = perfect square.
When, a>3, we have a^4 - 6a^2 +9 = (a^2-3)^2
But a^4-6a^2+4a-3 = perfect square.
When a>3, we have: a^4-6a^2+9=(a^2-3)^2
But, a^4-6a^2+4a-3< a^4 -4a^2+4
So, when a>3, we have:
(a^2-3)^2 < a^4 -6a^2 +4a-3 < (a^2-2)^2
This is a contradiction.
So, a≤3, and it remains to check a=1,2,3
When, a=1, a^4 -6a^2+4a-3 =-4, not a solution.
a=2, a^4 -6a^2+4a-3 =-3, not a solution.
a=3, a^4 -6a^2+4a-3 =36
Hence, x^2-8x+7=0
=> x= 1, 7
But x cannot be 1, because p^2-p=0, so p=0, 1. A contradiction since none of them are prime numbers.
Therefore x=7
=> 7^2+7+1 = 3*p
=> p=19
Checking, we have:
19^2-19+1 = 343 =7^3
Consequently, p=19 is the only solution to the given problem. |