What are the last three digits of the largest perfect square that can be expressed as p 2 + p q + q 2 , where p and q are (positive) prime numbers?
Note: If the last three digits of the number have a leading zero, just ignore it. IE If the sum is 1023, type your answer in as 23.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I could not understand why did you write p ≥ q . Seeing the expression it is obvious that it is symmetric w.r.t p and q . Rest all nice( though bit lengthy but well laid out). I give you a vote up..........
Log in to reply
I said p ≥ q , because in case 1, one of p + q + a and p + q − a was p , the other was q . This made the choice a little easier. Also, in subcase 3 of case 2, the fact that p ≥ q rules out the solution ( p , q ) = ( 3 , 5 ) , which is good, because I already found ( p , q ) = ( 5 , 3 ) . Does that make sense?
Log in to reply
I suppose it had been better off if you had mentioned that ( p , q ) is some permutation of the ordered pair ( 3 , 5 ) .
Log in to reply
@Nishant Sharma – I get your point, but I was trying to avoid awkward sentences like "either p or q is equal to p + q + a , so let's say that's p ". Of course, that could have been solved differently, like Muhammad A. does, by specifying that a is positive, which I didn't do.
If an equation is clearly symmetric, oftentimes we say "without loss of generality, assume p>q" or some similar statement, to avoid the problems Tim stated.
So, write the equation into :
p 2 + p q + q 2 = c 2 , where c is positive integer, then ( p + q ) 2 − p q = c 2 ⟹ ( p + q ) 2 − c 2 = p q ⟹ ( p + q + c ) ( p + q − c ) = p q ,
And, we know that R H S ≥ 0 ⟹ L H S ≥ 0 ⟹ ( p + q − c ) ≥ 0 . And, since p + q + c ≥ p + q . Since ( p + q − c ) ∣ p q , then
p + q + c = p q … … ( 1 )
since p + q + c ≥ p and q . So,
we also obtain p + q − c = 1 ⟹ c = p + q − 1 . … … ( 2 )
Then, from (1) and (2), we obtain : p + q + ( p + q − 1 ) = p q ⟹ ( p − 2 ) ( q − 2 ) = 3
So, it's easy to see that ( p , q ) = ( 3 , 5 ) or ( 5 , 3 )
we obtain that c 2 = p 2 + p q + q 2 = 3 2 + 3 ( 5 ) + 5 2 = 4 9
When we see the p 2 + p q + q 2 , we think of ( p + q ) 2 = p 2 + 2 p q + q 2 . Getting that into our equation, we get that ( p + q ) 2 − p q = k 2 ( p + q ) 2 − k 2 = p q ( p + q − k ) ( p + q + k ) = p q Now, p q has four factors. First, we try splitting p q into p and q . This doesn't work, since it would mean that k = ± p = ∓ q , but p and q are both positive. Therefore, p + q − k = 1 p + q + k = p q The sum of the equations gives 2 p + 2 q = p q + 1 We can use SFFT (http://www.aops.com/Wiki/index.php/Simon's Favorite Factoring_Trick). To do so we move over all terms, and try to make a convenient factorization with a linear p term and a linear q term. ( p − 2 ) ( q − 2 ) = 3 From this, ( p , q ) is some permutation of ( 3 , 5 ) , and so the answer is 3 2 + 3 ( 5 ) + 5 2 = 4 9
Without loss of generality, let's assume m is positive, satisfy: p^2 + p.q +q^2 = m^2.
If we add p.q to both side we have, (p + q)^2 = m^2 + p.q. We can write this expression in a factorized form (p + q + m)(p + q - m) = p.q.
We consider the following cases: (a)(p + q + m) = p, and (p + q - m) = q.This is impossible
(b) (p + q + m) = q, and (p + q - m) = p.This is also impossible
(c) (p + q + m) = p.q, and (p + q - m) = 1. From (c) by addition we will have 2p + 2q = 1 + p.q, or 2p - 1 = q(p - 2), so that we get q = (2p -1)/(p - 2) or q = 2 + 3/(p - 2). The possible values of (p - 2) is 1, or 3. So the values of p are 3, or 5. And the values of q are 5, or 3 respectively. The value of m can be obtain by subtracting both equations. in (c), m = (p.q - 1)/2. So the value of m^2 is{ (p.q - 1)/2}^2 = 49
good
Let the number be N = p 2 + p q + q 2 = ( p + q ) 2 − p q = ( p + q − i ) 2 (for some integer i < p , q )
So, ( p + q ) 2 − p q = ( p + q ) 2 − 2 i ( p + q ) + i 2 ⇒ p q = i ( 2 ( p + q ) − i )
Here, i divides RHS, so it must divide LHS i.e., p or q . But i < p , q ⇒ i = 1
Put i = 1 in the original relation to get: p = q − 2 2 q − 1 = 2 + q − 2 3 . Since p is integral, ( q − 2 ) must be ± 1 or ± 3 . Only q = 3 , 5 give integral p = 5 , 3 respectively. For both, ( p + q − 1 ) 2 = 4 9 .
If p 2 + p q + q 2 = N 2 , p q = ( p + q + N ) ( p + q − N ) . We can assume without loss of generality that N is positive.
Since p and q are prime, either p = p + q + N and q = p + q − N or p q = p + q + N and 1 = p + q − N . If p = p + q + N and q = p + q − N , 0 = q + N and 0 = p − N , which cannot be true since q > 0 . Thus, p q = p + q + N and 1 = p + q − N .
To simplify these equations, we cancel q and get N = p − 2 p 2 − p + 1 = p + 1 + p − 2 3 . This also works for q: N = p + 1 + p − 2 3 = q + 1 + q − 2 3 . Since N, p, and q are integers, p − 2 , q − 2 must either be 1 or 3, meaning p , q must either be 3 or 5. And if p = q , N 2 = 3 p 2 which is impossible. Thus, ( p , q ) = ( 3 , 5 ) and N = 3 2 + 3 ( 5 ) + 5 2 = 4 9 .
p^2 +pq +q^2=(p+q)^2-pq
Now because it has to be a perfect square let this be equal to x^2 for some natural number x
(p+q)^2-pq=x^2
(p+q)^2-x^2=pq
(p+q+x)(p+q-x)=pq
now because p and q are primes therefore
Case 1- (p+q+x)=p and (p+q-x)=q
this gives q=-x,p=x so we reject this case.
Case 2-(p+q+x)=q and (p+q-x)=q
this gives p=-x and q=x . so we reject this case.
Case 3- (p+q-x)=1 and (p+q+x)=pq
this case gives p+q=x+1, pq=2x+1
solving for p we get
p= x+1+√x^2-6x-3
because p is an integer x^2-6x-3 must be a perfect square
x^2-6x-3=(x-3)^2-12
It is easy to check that (x-3)^2 -12 is a perfect square for x=7
Now we just have to prove that this value of x is the greatest
For x>=7 (x-6)^2< x^2-6x-3<(x-3)^2
if x^2-6x-3=(x-5)^2 we get x=7
if x^2-6x-3=(x-4)^2 we get x=19/2 which is not a natural number
so only for x=7 x^2-6x-3 is a perfect square
also when x=7 p=5 and q=3 which are primes
So our answer is x^2=49 and the last three digits of 49 are 49
We factor over the Eisenstein integers. Let ω = cos 3 2 π + i sin 3 2 π . Then p 2 + p q + q 2 = ( p − q ω ) ( p − q ω 2 )
We claim that the factors on the RHS are relatively prime. To see this, note that their greatest common divisor must divide their difference which is q ( ω 2 − ω ) This is relatively prime to both factors however, so we must have g cd ( p − q ω , p − q ω 2 ) = 1
Since their product is a perfect square and they are coprime, there must exist positive integers a and b so that p − q ω = ( a − b ω ) 2 = ( a 2 − b 2 ) − ( 2 a b + b 2 ) ω where we have expanded and used the fact that ω 2 = − 1 − ω .
Now, this gives us p = a 2 − b 2 = ( a − b ) ( a + b ) q = 2 a b + b 2 = b ( 2 a + b )
For p to be a positive prime then, we require a − b = 1 , so a = b + 1 . Then q = b ( 3 b + 1 ) implies b = 1 (since q is prime), so a = 2 b = 1
Then p = 3 q = 5 giving us p 2 + p q + q 2 = 4 9
A nice solution, if only a little overpowering. The general method is to factor over the Gaussian integers whenever you see x 2 + y 2 , or the Eisenstein integers whenever you see x 2 + 3 y 2 or x 2 + x y + y 2 . I think this technique is of interest to the more advanced users on Brilliant.org. Maybe Calvin can look into this?
On a side note, I think it is necessary for the sake of completeness to state in the solution that the Eisenstein integers form a unique factorisation domain.
Log in to reply
Since the solution assumes knowledge of Eisenstein Integers, I thought it would not be that much of a stretch to assume the reader knows that they form a UFD.
Though, for future reference, I will try and note that.
We re-write p 2 + p q + q 2 as ( p + q ) 2 − p q . This must be the square of some integer n which is clearly less than p + q since p , q > 0 . We express n as ( p + q ) − k , where k is a positive integer.
Squaring ( p + q ) − k gives us ( p + q ) 2 − 2 k ( p + q ) + k 2 , which is what ( p + q ) 2 − p q is by definition. It follows that p q = 2 k ( p + q ) − k 2 = k ( 2 p + 2 q − k ) .
For the sake of contradiction, assume k > 1 . Because p , q are primes, either p = k or q = k and the other is 2 p + 2 q − k . Without loss of generality, let p = k . However, we now have q = 2 p + 2 q − k = 2 p + 2 q − p = p + 2 q → q = − p < 0 , which is impossible because p and q are given to be positive.
Therefore, k = 1 and p q = 2 p + 2 q − 1 . Rearranging, we have p q − 2 p − 2 q = − 1 → ( p − 2 ) ( q − 2 ) − 4 = − 1 → ( p − 2 ) ( q − 2 ) = 3 , which of course gives p = 3 , q = 5 (or vice versa). Thus, our answer is 3 2 + 3 ⋅ 5 + 5 2 = 4 9 .
Here, p^2+pq+q^2=n^2. Then p^2+2pq+q^2=(p+q)^2=n^2+pq.
which gives (p+q)^2−n^2=(p+q+n)(p+q−n)=pq.
since p and q are primes ,
Two cases are possible.(taking p>q )
p+q+n=p and p+q−n=q which gives, q=-n (not possible) and p=n hence p+q+n=pq and p+q−n=1 Adding these two equations,we get
2p+2q=pq-1
pq + 2p + 2q + 4= 3
(p-2)(q-2)=3
since q<p,
q - 2 = 1 and p - 2 = 3 is the only choice available.
which gives q=3 and p=5
so
p^2+pq+q^2=3^2+3(5)+5^2=49
Without loss of generality, let's assume m is positive, satisfy: p^2 + p.q +q^2 = m^2.
If we add p.q to both side we have, (p + q)^2 = m^2 + p.q. We can write this expression in a factorized form (p + q + m)(p + q - m) = p.q.
We consider the following cases: (a)(p + q + m) = p, and (p + q - m) = q.This is impossible
(b) (p + q + m) = q, and (p + q - m) = p.This is also impossible
(c) (p + q + m) = p.q, and (p + q - m) = 1. From (c) by addition we will have 2p + 2q = 1 + p.q, or 2p - 1 = q(p - 2), so that we get q = (2p -1)/(p - 2) or q = 2 + 3/(p - 2). The possible values of (p - 2) is 1, or 3. So the values of p are 3, or 5. And the values of q are 5, or 3 respectively. The value of m can be obtain by subtracting both equations. in (c), m = (p.q - 1)/2. So the value of m^2 is{ (p.q - 1)/2}^2 = 49
let, p^2+pq+q^2=m^2 then, (p+q)^2−pq=m^2 \Rightarrow (p+q)^2−m^2=pq \Rightarrow (p+q+m)(p+q−m)=pq we know, that p,q,m \geq 0, so (p+q+m)>p [(p+q+m) \neq p], (p+q+m)>q[(p+q+m) \neq q] and (p+q+m)>(p+q-m)[p,q>0] and these implies (p+q+m)=pq[we know that p,q are primes] and (p+q-m)=1 So, 2(p+q)=pq+1 \Rightarrow pq-2p-2q+1=0 \Rightarrow (p-2)(q-2)-3=0 \Rightarrow (p-2)(q-2)=3. this is symmetric on p and q, so either (p-2)=3 \Rightarrow p=5 and (q-2)=1 \Rightarrow q=3 Or, (p-2)=1 \Rightarrow p=3 and (q-2)=3 \Rightarrow q=5 So, (p,q)=(3,5) and (5,3) the given equation is symmetric on p and q, so, the value of the equation is (3^2 + 3 \times 5 + 5^2)=49[answer]
Without loss of generality, let p ≥ q
We let p 2 + p q + q 2 = r 2 . Then p 2 + 2 p q + q 2 = r 2 + p q , so ( p + q ) 2 = r 2 + p q , and ( p + q ) 2 − r 2 = p q . Hence ( p + q + r ) ( p + q − r ) = p q . Since p and q are primes, we have 2 cases: p + q + r = p q and p + q − r = 1 (this is because p + q + r > p + q − r , or p + q + r = p and p + q − r = q (this is because p + q + r > p + q − r and p > q .
Case 1: p + q + r = p q and p + q − r = 1 Then r = p + q − 1 , so p + q + p + q − 1 = p q . Thus 2 p + 2 q − 1 = p q . Hence p q − 2 p − 2 q + 1 = 0 , and ( p − 2 ) ( q − 2 ) − 3 = 0 . Thus ( p − 2 ) ( q − 2 ) = 3 . Since p ≥ 2 and q ≥ 2 , both p − 2 and q − 2 are positive. Hence p − 2 = 3 and q − 2 = 1 , meaning that p = 5 and q = 3 . Hence, p 2 + p q + q 2 = ( 5 ) 2 + ( 5 ) ( 3 ) + ( 3 ) 2 = 2 5 + 1 5 + 9 = 4 9 .
Case 2: p + q + r = p and p + q − r = q From the first equation we get q + r = 0 . Thus q = − r . From the 2nd equation we get p − r = 0 , so p = r . Hence − p = − r , so − p = q . However, p and q are positive so this is not possible.
Thus, the largest perfect square that can be expressed in the form p 2 + p q + q 2 , where p and q are (positive) prime numbers is 4 9 , so it's last 3 digits is 0 4 9
Let p^2+pq+q^2=a^2. Then p^2+2pq+q^2=(p+q)^2=a^2+pq.
which gives (p+q)^2−a^2=(p+q+a)(p+q−a)=pq.
since p and q are primes , L.H.S has exactly two prime factors.
Two cases are possible.(taking p>q )
p+q+a=p and p+q−a=q
which gives, q=-a (not possible) and p=a
hence p+q+a=pq and p+q−a=1 Adding these two equations,we get
2p+2q=pq-1
pq + 2p + 2q + 4= 3
(p-2)(q-2)=3 (a priime number)
since q<p, q - 2 = 1 and p - 2 = 3 is the only choice available
which gives q=3 and p=5
*So,there is only one possible such number=3^2 + 3 5 +5^2=49. **
In the problem it's given that: p2+pq+q2, now completing the square (p+q)2=p2+2pq+q2. and getting that into the problem, the following is obtained:
(p+q)2−pq=a2
(p+q)2−a2=pq Factoring it as the difference of 2 squares......... (p+q−a)(p+q+a)=pq Since p,q are primes , pq has four factors. First, pq is split into p and q. It would mean that 2(p+q)=p+q , p+q=0 but p and q are both positive. So this case can't be taken into account. So, p+q−a=1 p+q+a=pq (Sine p, q, a are all positive their sum is always > 1, and p,q are themselves > 1 ;so p+q+a is taken to be = pq). Adding the equations............ 2p+2q=pq+1
Doing a little algebra ( this is often a standard technique which results from an effective factorization by taking pq to L.H.S. and taking p common then adjusting the remaining )
(p−2)(q−2)=3
From here possible values are: p-2=1 and q-2=3 or the reverse that is p-2=3 and q-2=1
(note that taking other values viz p-2=-1 and q-2=-3 would yield negative solutions so this case is avoided)
the equations give p=5,q=3 or p=3,q=5......putting this values in : a= pq-p-q gives a=7 and squarring it gives a as 49. So the answer is 49.
p 2 + p q + q 2 = ( p + q ) 2 − p q = k 2 where k 2 is the perfect square. Rearranging, we get: ( p + q ) 2 − k 2 = p q ⟹ ( p + q + k ) ( p + q − k ) = p q We have case 1: p=q. Checking, we can clearly see that this is impossible case 2: p + q + k = p q and p + q − k = 1 (It can't be the other way around) By elimination, we get that p + q + ( p + q − 1 ) = p q ⟹ ( p − 2 ) ( p − 2 ) = 3 We see that ( 3 , 5 ) is a valid solution, so we plug that in to get 4 9
p^2 + pq +q^2 = k^2 ,
or, (p+q)^2 - pq =k^2
or, (p+q-k)(p+q+k) = pq
which gives, either
(i) p+q-k = p and p+q-k =q
(ii) p+q-k=q and p+q+k=p
(iii) p+q-k=pq and p+q+k=1
(iv) p+q-k =1 and p+q+k =pq
from (i) we get p = -q not possible as p and q are +ve primes.
from (ii) we get p = -q not possible as p and q are +ve primes.
eliminating k from (iii) and (iv) we get 2(p+q) = pq+1
or (p-2)(q-2)=3.
solving we get either p=3 and q=5, or p=5 and q=3.
substituting in p^2 +pq +q^2 = (3)^2 + (3)(5) + (5)^2 = 49 = (7)^2.
threrefore, last three digits are 049 or 49.
As far as I can tell, the only value possible is 49 (so 049). Call this perfect square a^2 with a>0 Comparing to the expansion of (p+q)^2, pq = (p+q)^2-a^2= (p+q+a)(p+q-a) Since both terms on the Rhs are integers, we can consider the factors of pq which, since p and q are prime are 1,p,q,pq and p+q+a and p+q-a must then fit into this set. Since p,q,a are >0, p+q+a cannot be equal to p or q so these factors must be pq and 1 respectively. The lesser is p+q-a=1 => a=p+q-1 The greater is pq= p+q +a = 2p+2q-1 So q(p-2)=2p-1, q= (2p-1)/(p-2) Since q is an integer, q-2 is also an integer which is (2p-1-2p--4)/(p-2)= 3/(p-2) So p-2 is a factor of 3, which is either 1 or 3. P is either 3 or 5, q is either 5 or 3 (in pairs of 3 and 5). This gives the expression given as 25+15+9=49 and a=7 Let me know if I've missed anything- but unless there's a mistake this is the only such square.
Call this perfect square a^2 with a>0
Comparing to the expansion of (p+q)^2, pq = (p+q)^2-a^2= (p+q+a)(p+q-a)
Since both terms on the Rhs are integers, we can consider the factors of pq which, since p and q are prime are 1,p,q,pq and p+q+a and p+q-a must then fit into this set.
Since p,q,a are >0, p+q+a cannot be equal to p or q so these factors must be pq and 1 respectively.
The lesser is p+q-a=1 => a=p+q-1
The greater is pq= p+q +a = 2p+2q-1
So q(p-2)=2p-1, q= (2p-1)/(p-2)
Since q is an integer, q-2 is also an integer which is (2p-1-2p--4)/(p-2)= 3/(p-2)
So p-2 is a factor of 3, which is either 1 or 3. P is either 3 or 5, q is either 5 or 3 (in pairs of 3 and 5).
This gives the expression given as 25+15+9=49 and a=7
It's possible when ( p + q ) 2 − ( p + q − k ) 2 = p q
=> 2 k p + 2 k q − k 2 = pq
=> p(q-2k) = 2 k q − k 2
=> p(q-2k) = 2 k ( q − 2 k ) + 3 k 2
=> p = 2k+ q − 2 k 3 k 2
so q-2k = 3 or q-2k = 1, in both case (p,q,k) = (5,3,1)
So answer = 3 2 + × 3 5 + 5 2 = 49
If p^2+pq+q^2=n^2 then pq=(p+q)^2-n^2=(p+q+n)(p+q-n) Since p, q are positive primes, we must have p+q+n=pq, p+q-n=1, so 2 (p+q)=pq+1, so (p-2)(q-2)=3. Thus {p, q} = {5, 3}, so n=pq-p-q=7, so n^2=49
p 2 + p q + q 2 = k 2 → ( p + q − k ) ( p + q + k ) = p . Assume WLOG p ≥ q . Since p & q are both primes and p + q + k ≥ p + q − k we have that either p + q − k = p & p + q + k = q or p + q − k = 1 & p + q + k = p q . The first case gives us that p = − k which is a contradiction as both p and k are positive integers. The second case gives us that p + q + k = p q → ( p − 1 ) ( q − 1 ) = k + 1 and p + q − k = 1 → p + q = k + 1 . Solving for q − 1 , we get that ( p − 1 ) ( q − 1 ) = p + q → q − 1 = p − 2 p + 1 . Thus ( p − 1 ) ( q − 1 ) = k + 1 → ( p − 1 ) ( p − 2 p + 1 ) = k + 1 . Since p − 1 and p − 2 differ by one, they are relatively prime. Thus p − 2 ∣ p + 1 . Since p − 2 must divide p + 1 and they differ by 3 and p − 2 ≥ 0 , p − 2 must equal 3 . This means that p = 5 and k 2 = 4 9 .
Let p 2 + q 2 + p q = n 2 -------( ∗ ) for some positive integer, n .
From ---( ∗ ) we manipulate as ( p + q ) 2 − p q = n 2
or ( p + q ) 2 − n 2 = p q
or ( p + q + n ) ( p + q − n ) = p q
Now, since p and q are primes cases are:
(i) ( p + q + n ) = p and ( p + q − n ) = q , which implies p + q = 0 which is impossible,
(ii) ( p + q + n ) = q and ( p + q − n ) = p , which is similar to (i), so ruled out,
(iii) ( p + q + n ) = p q and ( p + q − n ) = 1 ( this is equivalent to saying that ( p + q + n ) = 1 and ( p + q − n ) = p q ) ,adding the two we get
2 p + 2 q = 1 + p q
or ( p − 2 ) ( q − 2 ) = 3
or ( p − 2 ) = 3 and ( q − 2 ) = 1
or ( p , q ) = ( 5 , 3 ) and vice-versa
Plugging in ( p , q ) = ( 5 , 3 ) in eqn-( ∗ ), we find n 2 = 5 2 + 5 × 3 + 3 2 = 5 × ( 5 + 3 ) + 3 2 = 4 0 + 9 = 4 9 which is our answer.
Suppose p 2 + p q + q 2 = k 2 , wheere k is positive integer,then ( p + q ) 2 − p q = k 2 ( p + q ) 2 − k 2 = p q → ( p + q + k ) ( p + q − k ) = p q , we know that R H S ≥ 0 and L H S ≥ 0 ( p + q − k ) ≥ 0 And,since p + q + k ≥ p + q ∣ p q ,then p + q + k = p q since p + q + k ≥ p and q .So, we can obtain p + q − k = 1 → k = p + q − 1 from that we can get p + q + ( p + q − 1 ) = p q ( p − 2 ) ( q − 2 ) = 3 ( p . q ) = ( 5 , 3 ) o r ( 3 , 5 ) we can obtain that p 2 + q 2 + p q = 3 2 + 5 2 + 3 . 5 = 4 9
Let said perfect square be represented by a 2 , where a is a positive integer. Then we have that p 2 + p q + q 2 = ( p + q ) 2 − p q = a 2 ⟹ ( p + q − a ) 2 = p q Since p q can only be factored in two ways ( p , q or 1 , p q ) due to p q being a product of only two primes, we have two possible cases:
Case 1: p + q − a = p , p + q + a = q (assuming wlog that p < q ) Simplifying leads to the reduced equations q = a and p = − a , a contradiction, since p must be positive. So this case cannot happen.
Case 2: p + q − a = 1 , p + q + a = p q From the first equation we have p + q = a + 1 . Working with the second equation, we get that p q − p − q = a ⟹ ( p − 1 ) ( q − 1 ) = p q − p − q + 1 = a + 1 However, since p + q = a + 1 , we have p + q = ( p − 1 ) ( q − 1 ) ⟹ p + q = p q − p − q + 1 ⟹ p q − 2 p − 2 q + 4 = 3 ⟹ ( p − 2 ) ( q − 2 ) = 3 Since the only way to factor 3 is into 1 , 3 , we must have p − 2 = 3 , q − 2 = 1 (or the other way around), which results in p = 5 , q = 3 . Then a 2 = p 2 + p q + q 2 = 2 5 + 1 5 + 9 = 0 4 9 .
p^2+q^2+pq = (m^2+k^2+mk)2 = (m^2-k^2)2+(k^2+2mk)2+(k^2+2mk)(m^2-k^2) p = m^2 - k^2 and q = k^2 + 2mk since q is a prime ,k = 1 and hence q = 2m+1 and p = m2-1 since p is also prime p = (m-1)(m+1) => m-1=1 i.e m=2 hence we got p=3 and q=5 as only solution thus p^2+q^2+pq = 49 hence last three digits of perfect square is 049
Without loss of generality assume that p ≤ q .
Let p 2 + p q + q 2 = ( p + k ) 2 , where k is a positive integer. Now if k ≥ q then p 2 + p q + q 2 = ( p + k ) 2 ≥ ( p + q ) 2 = p 2 + 2 p q + q 2 , or p q ≤ 0 , contradiction. Hence 0 < k < q , so q ∤ k .
From p 2 + p q + q 2 = ( p + k ) 2 we get ( p + q ) q = ( 2 p + k ) k . Since q ∤ k , we have q ∣ 2 p + k . But 0 < 2 p + k < 2 q + q = 3 q , so either 2 p + k = q or 2 p + k = 2 q .
If 2 p + k = q then p 2 + p q + q 2 = ( p + k ) 2 = ( q − p ) 2 = p 2 − 2 p q + q 2 , so p q = 0 , contradiction.
If 2 p + k = 2 q then p 2 + p q + q 2 = ( p + k ) 2 = ( 2 q − p ) 2 = p 2 − 4 p q + 4 q 2 , so 4 q 2 − 4 p q = p q + q 2 . Factoring out q and rearranging terms, we get 3 q = 5 p . Thus 3 ∣ p and 5 ∣ q , so ( p , q ) = ( 3 , 5 ) , and thus p 2 + p q + q 2 = 9 + 1 5 + 2 5 = 4 9 .
Since 49 is the only square of the form p 2 + p q + q 2 with p , q prime, the answer is 4 9 .
Let x be a positive integer. Then we have the equation p 2 + p q + q 2 = x 2 , or ( p + q ) 2 − p q = x 2 . Rearranging this, we get ( p + q ) 2 − x 2 = p q , and by difference of squares, ( p + q + x ) ( p + q − x ) = p q . Without loss of generality, let p ≥ q . Also notice that p + q + x > p + q − x because x is positive. Because p and q are primes, the only possible factor pairs are p , q and 1 , p q , so we have the cases p + q + x = p , p + q − x = q , and p + q + x = p q , p + q − x = 1 . Taking the first equation of the first case, we see that q + x = 0 , which is impossible because both q and x are positive.
Taking the second case, we add the two given equations to get 2 p + 2 q = p q + 1 p q − 2 p − 2 q + 1 = 0 ( p − 2 ) ( q − 2 ) = 3 So, p − 2 = 3 and q − 2 = 1 , hence p = 5 , q = 3 . Substituting into the equation p 2 + p q + q 2 = x 2 , we get x 2 = 5 2 + 5 ( 3 ) + 3 2 = 4 9 . Thus, the answer is 4 9 .
p^2+pq+q^2 is a perfect square the it must be equal to some positive integer k^2 then p^2+pq+q^2=k^2 or (p+q)^2-pq=k^2 or (p+q)^2-k^2=pq (p+q+k)(p+q-k)=pq now two cases arise case-1 p+q+k=p p+q-k=q on solving we get p=-q which is not possible as p and q are +ve case-2 p+q+k=pq p+q-k=1 now we eliminate k from equations we get p+q+(p+q-1)=pq =>(p−2)(q−2)=3 (p,q)=(3,5) or (5,3) so p^2+pq+q^2=32+3(5)+52=49
p^2+pq+q^2 is a perfect square the it must be equal to some positive integer k^2 then p^2+pq+q^2=k^2 or (p+q)^2-pq=k^2 or (p+q)^2-k^2=pq (p+q+k)(p+q-k)=pq now two cases arise case-1 p+q+k=p p+q-k=q on solving we get p=-q which is not possible as p and q are +ve case-2 p+q+k=pq p+q-k=1 now we eliminate k from equations we get p+q+(p+q-1)=pq =>(p−2)(q−2)=3 (p,q)=(3,5) or (5,3) so p^2+pq+q^2=32+3(5)+52=49 key technique:-simple algebra manipulation and lil bit knowledge about primes and factorization
Problem Loading...
Note Loading...
Set Loading...
Assume, without loss of generality, that p ≥ q . Say p 2 + p q + q 2 = a 2 . Then p 2 + 2 p q + q 2 = ( p + q ) 2 = a 2 + p q . Using the difference of two squares factorization, ( p + q ) 2 − a 2 = ( p + q + a ) ( p + q − a ) = p q . There are two cases.
Case 1 { p + q + a = p p + q − a = q This implies: { q = − a p = a So, p = − q . But p and q are both positive, so this case yields no solutions.
Case 2 { p + q + a = p q p + q − a = 1
Adding these two equations together, you get 2 p + 2 q 2 p − p q p ( 2 − q ) p = p q + 1 = 1 − 2 q = 1 − 2 q = 2 − q 1 − 2 q = q − 2 2 q − 1
Also, 2 q − 1 = 2 ( q − 2 ) + 3 , so q − 2 ∣ 2 q − 1 ⟹ q − 2 ∣ 3 ⟹ q − 2 ∈ { − 3 , − 1 , 1 , 3 } ⟹ q ∈ { 1 , 3 , 5 } , as q is positive. Three subcases:
So, there is only one possibility, which is p = 5 and q = 3 . Then a 2 = p 2 + p q + q 2 = 2 5 + 1 5 + 9 = 4 9 .