Square your peas and queues

What are the last three digits of the largest perfect square that can be expressed as p 2 + p q + q 2 , p^2+pq+q^2, where p p and q 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.


The answer is 49.

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.

30 solutions

Tim Vermeulen
Jul 14, 2013

Assume, without loss of generality, that p q p\geq q . Say p 2 + p q + q 2 = a 2 p^2 + pq + q^2 = a^2 . Then p 2 + 2 p q + q 2 = ( p + q ) 2 = a 2 + p q p^2 + 2pq + q^2 = (p+q)^2 = a^2 + pq . Using the difference of two squares factorization, ( p + q ) 2 a 2 = ( p + q + a ) ( p + q a ) = p q (p+q)^2-a^2=(p+q+a)(p+q-a) = pq . There are two cases.

Case 1 { p + q + a = p p + q a = q \begin{cases} p+q+a=p\\ p+q-a=q \end{cases} This implies: { q = a p = a \begin{cases} q=-a\\ p=a \end{cases} So, p = q p=-q . But p p and q q are both positive, so this case yields no solutions.

Case 2 { p + q + a = p q p + q a = 1 \begin{cases} p+q+a=pq\\ p+q-a=1 \end{cases}

Adding these two equations together, you get 2 p + 2 q = p q + 1 2 p p q = 1 2 q p ( 2 q ) = 1 2 q p = 1 2 q 2 q = 2 q 1 q 2 \begin{aligned} 2p + 2q&=pq+1 \\ 2p -pq&=1-2q\\ p(2-q)&=1-2q \\ p&=\frac{1-2q}{2-q} = \frac{2q-1}{q-2} \end{aligned}

Also, 2 q 1 = 2 ( q 2 ) + 3 2q-1 = 2(q-2)+3 , so q 2 2 q 1 q 2 3 q 2 { 3 , 1 , 1 , 3 } q { 1 , 3 , 5 } q-2 \mid 2q-1 \implies q-2 \mid 3 \implies q-2 \in \{-3,-1,1,3\} \implies q \in \{1,3,5\} , as q q is positive. Three subcases:

  • q = 1 p = 1 1 = 1 q=1 \implies p = \frac{1}{-1} = -1 , which is not positive.
  • q = 3 p = 5 1 = 5 q=3 \implies p = \frac{5}{1} = 5 .
  • q = 5 p = 9 3 = 3 q=5 \implies p = \frac{9}{3} = 3 , but p q p\geq q , and 3 ≱ 5 3\not\geq 5 .

So, there is only one possibility, which is p = 5 p=5 and q = 3 q=3 . Then a 2 = p 2 + p q + q 2 = 25 + 15 + 9 = 49 a^2=p^2+pq+q^2=25+15+9=\boxed{49} .

I could not understand why did you write p p \geq q q . Seeing the expression it is obvious that it is symmetric w.r.t p p and q q . Rest all nice( though bit lengthy but well laid out). I give you a vote up..........

Nishant Sharma - 7 years, 11 months ago

Log in to reply

I said p q p \geq q , because in case 1, one of p + q + a p+q+a and p + q a p+q-a was p p , the other was q q . This made the choice a little easier. Also, in subcase 3 of case 2, the fact that p q p\geq q rules out the solution ( p , q ) = ( 3 , 5 ) (p,q) = (3,5) , which is good, because I already found ( p , q ) = ( 5 , 3 ) (p,q)=(5,3) . Does that make sense?

Tim Vermeulen - 7 years, 11 months ago

Log in to reply

I suppose it had been better off if you had mentioned that ( \big( p , q p,q ) \big) is some permutation of the ordered pair ( \big( 3 , 5 3,5 ) \big) .

Nishant Sharma - 7 years, 11 months ago

Log in to reply

@Nishant Sharma I get your point, but I was trying to avoid awkward sentences like "either p p or q q is equal to p + q + a p+q+a , so let's say that's p p ". Of course, that could have been solved differently, like Muhammad A. does, by specifying that a a is positive, which I didn't do.

Tim Vermeulen - 7 years, 11 months ago

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.

M M - 5 years ago
Muhammad Al Kahfi
Jul 14, 2013

So, write the equation into :

p 2 + p q + q 2 = c 2 p^2 + pq + q^2 = c^2 , where c 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 (p+q)^2 - pq = c^2 \implies (p+q)^2 - c^2 = pq \implies (p+q+c)(p+q-c) = pq ,

And, we know that R H S 0 L H S 0 ( p + q c ) 0 RHS \ge 0 \implies LHS \ge 0 \implies (p+q-c) \ge 0 . And, since p + q + c p + q p+q + c \ge p + q . Since ( p + q c ) p q (p+q-c) | pq , then

p + q + c = p q ( 1 ) p+q+c = pq \ldots \ldots (1)

since p + q + c p p+q+c \ge p and q q . So,

we also obtain p + q c = 1 c = p + q 1. ( 2 ) p + q - c = 1 \implies c = p + q - 1.\ldots \ldots (2)

Then, from (1) and (2), we obtain : p + q + ( p + q 1 ) = p q ( p 2 ) ( q 2 ) = 3 p + q + (p + q - 1) = pq \implies (p - 2)(q - 2) = 3

So, it's easy to see that ( p , q ) = ( 3 , 5 ) (p, q) = (3, 5) or ( 5 , 3 ) (5, 3)

we obtain that c 2 = p 2 + p q + q 2 = 3 2 + 3 ( 5 ) + 5 2 = 49 c^2 =p^2 + pq + q^2 = 3^2 + 3(5) + 5^2 = \boxed{49}

Daniel Chiu
Jul 14, 2013

When we see the p 2 + p q + q 2 p^2+pq+q^2 , we think of ( p + q ) 2 = p 2 + 2 p q + q 2 (p+q)^2=p^2+2pq+q^2 . Getting that into our equation, we get that ( p + q ) 2 p q = k 2 (p+q)^2-pq=k^2 ( p + q ) 2 k 2 = p q (p+q)^2-k^2=pq ( p + q k ) ( p + q + k ) = p q (p+q-k)(p+q+k)=pq Now, p q pq has four factors. First, we try splitting p q pq into p p and q q . This doesn't work, since it would mean that k = ± p = q k=\pm p=\mp q , but p p and q q are both positive. Therefore, p + q k = 1 p+q-k=1 p + q + k = p q p+q+k=pq The sum of the equations gives 2 p + 2 q = p q + 1 2p+2q=pq+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 p term and a linear q q term. ( p 2 ) ( q 2 ) = 3 (p-2)(q-2)=3 From this, ( p , q ) (p,q) is some permutation of ( 3 , 5 ) (3,5) , and so the answer is 3 2 + 3 ( 5 ) + 5 2 = 49 3^2+3(5)+5^2=\boxed{49}

Anubhav Singh
Jul 19, 2013

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

gfhh gfh - 7 years, 10 months ago

Let the number be N = p 2 + p q + q 2 = ( p + q ) 2 p q = ( p + q i ) 2 N = p^2 + p q + q^2 = (p + q)^2 - p q = (p + q - i)^2 (for some integer i < p , q 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 ) (p + q)^2 - p q = (p + q)^2 - 2 i (p+q) + i^2 \Rightarrow p q = i ( 2(p + q) - i)

Here, i i divides RHS, so it must divide LHS i.e., p p or q q . But i < p , q i = 1 i < p,q \Rightarrow i=1

Put i = 1 i =1 in the original relation to get: p = 2 q 1 q 2 = 2 + 3 q 2 p = \frac{2q - 1}{q - 2} = 2 + \frac{3}{q - 2} . Since p p is integral, ( q 2 ) (q - 2) must be ± 1 \pm 1 or ± 3 \pm 3 . Only q = 3 , 5 q = 3 , 5 give integral p = 5 , 3 p = 5 , 3 respectively. For both, ( p + q 1 ) 2 = 49 (p + q - 1)^2 = 49 .

Oscar Harmon
Jul 14, 2013

If p 2 + p q + q 2 = N 2 p^2+pq+q^2=N^2 , p q = ( p + q + N ) ( p + q N ) pq=(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 p=p+q+N and q = p + q N q=p+q-N or p q = p + q + N pq=p+q+N and 1 = p + q N 1=p+q-N . If p = p + q + N p=p+q+N and q = p + q N q=p+q-N , 0 = q + N 0=q+N and 0 = p N 0=p-N , which cannot be true since q > 0 q>0 . Thus, p q = p + q + N pq=p+q+N and 1 = p + q N 1=p+q-N .

To simplify these equations, we cancel q and get N = p 2 p + 1 p 2 = p + 1 + 3 p 2 N=\frac{p^2-p+1}{p-2}=p+1+\frac{3}{p-2} . This also works for q: N = p + 1 + 3 p 2 = q + 1 + 3 q 2 N=p+1+\frac{3}{p-2}=q+1+\frac{3}{q-2} . Since N, p, and q are integers, p 2 , q 2 p-2,q-2 must either be 1 or 3, meaning p , q p,q must either be 3 or 5. And if p = q p=q , N 2 = 3 p 2 N^2=3p^2 which is impossible. Thus, ( p , q ) = ( 3 , 5 ) (p,q)=(3,5) and N = 3 2 + 3 ( 5 ) + 5 2 = 49 N=3^2+3(5)+5^2=49 .

Aman Tiwari
Jul 19, 2013

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

Shyan Akmal
Jul 17, 2013

We factor over the Eisenstein integers. Let ω = cos 2 π 3 + i sin 2 π 3 \omega= \cos\frac{2\pi}{3}+i\sin\frac{2\pi}{3} . Then p 2 + p q + q 2 = ( p q ω ) ( p q ω 2 ) p^2+pq+q^2 = (p-q\omega)(p-q\omega^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 ω ) q(\omega^2 - \omega) This is relatively prime to both factors however, so we must have gcd ( p q ω , p q ω 2 ) = 1 \gcd(p-q\omega, p-q\omega^2) = 1

Since their product is a perfect square and they are coprime, there must exist positive integers a a and b b so that p q ω = ( a b ω ) 2 = ( a 2 b 2 ) ( 2 a b + b 2 ) ω p-q\omega = (a-b\omega)^2 = (a^2 - b^2) - (2ab+b^2)\omega where we have expanded and used the fact that ω 2 = 1 ω \omega^2 = -1 - \omega .

Now, this gives us p = a 2 b 2 = ( a b ) ( a + b ) p =a^2-b^2=(a-b)(a+b) q = 2 a b + b 2 = b ( 2 a + b ) q=2ab+b^2=b(2a+b)

For p p to be a positive prime then, we require a b = 1 a-b=1 , so a = b + 1 a=b+1 . Then q = b ( 3 b + 1 ) q=b(3b+1) implies b = 1 b=1 (since q q is prime), so a = 2 a=2 b = 1 b=1

Then p = 3 p=3 q = 5 q=5 giving us p 2 + p q + q 2 = 49 p^2+pq+q^2=49

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 x^2+y^2 , or the Eisenstein integers whenever you see x 2 + 3 y 2 x^2+3y^2 or x 2 + x y + y 2 x^2+xy+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.

Ang Yan Sheng - 7 years, 10 months ago

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.

Shyan Akmal - 7 years, 10 months ago

We re-write p 2 + p q + q 2 p^2+pq+q^2 as ( p + q ) 2 p q (p+q)^2-pq . This must be the square of some integer n n which is clearly less than p + q p+q since p , q > 0 p,q>0 . We express n n as ( p + q ) k (p+q)-k , where k k is a positive integer.

Squaring ( p + q ) k (p+q)-k gives us ( p + q ) 2 2 k ( p + q ) + k 2 (p+q)^2-2k(p+q)+k^2 , which is what ( p + q ) 2 p q (p+q)^2-pq is by definition. It follows that p q = 2 k ( p + q ) k 2 = k ( 2 p + 2 q k ) pq = 2k(p+q) - k^2 = k(2p+2q-k) .

For the sake of contradiction, assume k > 1 k>1 . Because p , q p,q are primes, either p = k p=k or q = k q=k and the other is 2 p + 2 q k 2p+2q-k . Without loss of generality, let p = k p=k . However, we now have q = 2 p + 2 q k = 2 p + 2 q p = q = 2p + 2q - k = 2p + 2q - p = p + 2 q q = p < 0 p + 2q \to q = -p < 0 , which is impossible because p p and q q are given to be positive.

Therefore, k = 1 k=1 and p q = 2 p + 2 q 1 pq = 2p+2q-1 . Rearranging, we have p q 2 p 2 q = 1 ( p 2 ) ( q 2 ) 4 = 1 pq-2p-2q=-1 \to (p-2)(q-2)-4=-1 \to ( p 2 ) ( q 2 ) = 3 (p-2)(q-2)=3 , which of course gives p = 3 , q = 5 p=3,q=5 (or vice versa). Thus, our answer is 3 2 + 3 5 + 5 2 = 49 3^2+3\cdot5+5^2=\fbox{49} .

Harsa Mitra
Jul 17, 2013

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

Ruslan Abdulgani
Jul 16, 2013

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

Debjit Mandal
Jul 16, 2013

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]

Russell Few
Jul 15, 2013

Without loss of generality, let p q p \ge q

We let p 2 + p q + q 2 = r 2 p^2+pq+q^2=r^2 . Then p 2 + 2 p q + q 2 = r 2 + p q p^2+2pq+q^2=r^2+pq , so ( p + q ) 2 = r 2 + p q (p+q)^2=r^2+pq , and ( p + q ) 2 r 2 = p q (p+q)^2-r^2=pq . Hence ( p + q + r ) ( p + q r ) = p q (p+q+r)(p+q-r)=pq . Since p p and q q are primes, we have 2 cases: p + q + r = p q p+q+r=pq and p + q r = 1 p+q-r=1 (this is because p + q + r > p + q r p+q+r>p+q-r , or p + q + r = p p+q+r=p and p + q r = q p+q-r=q (this is because p + q + r > p + q r p+q+r>p+q-r and p > q p>q .

Case 1: p + q + r = p q p+q+r=pq and p + q r = 1 p+q-r=1 Then r = p + q 1 r=p+q-1 , so p + q + p + q 1 = p q p+q+p+q-1=pq . Thus 2 p + 2 q 1 = p q 2p+2q-1=pq . Hence p q 2 p 2 q + 1 = 0 pq-2p-2q+1=0 , and ( p 2 ) ( q 2 ) 3 = 0 (p-2)(q-2)-3=0 . Thus ( p 2 ) ( q 2 ) = 3 (p-2)(q-2)=3 . Since p 2 p \ge 2 and q 2 q \ge 2 , both p 2 p-2 and q 2 q-2 are positive. Hence p 2 = 3 p-2=3 and q 2 = 1 q-2=1 , meaning that p = 5 p=5 and q = 3 q=3 . Hence, p 2 + p q + q 2 = ( 5 ) 2 + ( 5 ) ( 3 ) + ( 3 ) 2 = 25 + 15 + 9 = 49 p^2+pq+q^2=(5)^2+(5)(3)+(3)^2=25+15+9=49 .

Case 2: p + q + r = p p+q+r=p and p + q r = q p+q-r=q From the first equation we get q + r = 0 q+r=0 . Thus q = r q=-r . From the 2nd equation we get p r = 0 p-r=0 , so p = r p=r . Hence p = r -p=-r , so p = q -p=q . However, p p and q 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 p^2+pq+q^2 , where p and q are (positive) prime numbers is 49 49 , so it's last 3 digits is 049 \boxed{049}

Vostro Del
Jul 15, 2013

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. **

Piyal De
Jul 14, 2013

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.

Harrison Lian
Jul 20, 2013

p 2 + p q + q 2 = ( p + q ) 2 p q = k 2 p^2+pq+q^2=(p+q)^2-pq=k^2 where k 2 k^2 is the perfect square. Rearranging, we get: ( p + q ) 2 k 2 = p q ( p + q + k ) ( p + q k ) = p q (p+q)^2-k^2=pq \Longrightarrow (p+q+k)(p+q-k)=pq We have case 1: p=q. Checking, we can clearly see that this is impossible case 2: p + q + k = p q p+q+k=pq and p + q k = 1 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 p+q+(p+q-1)=pq \Longrightarrow (p-2)(p-2)=3 We see that ( 3 , 5 ) (3,5) is a valid solution, so we plug that in to get 49 \boxed{49}

Shivam Gautam
Jul 19, 2013

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.

Kashish Gupta
Jul 19, 2013

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.

Evan Chien
Jul 19, 2013

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

Zakir Dakua
Dec 17, 2015

It's possible when ( p + q ) 2 ( p + q k ) 2 = p q (p+q)^{2}-(p+q-k)^{2} = pq

=> 2 k p + 2 k q k 2 2kp+2kq-k^{2} = pq

=> p(q-2k) = 2 k q k 2 2kq-k^{2}

=> p(q-2k) = 2 k ( q 2 k ) + 3 k 2 2k(q-2k)+3k^{2}

=> p = 2k+ 3 k 2 q 2 k \frac{3k^{2}}{q-2k}

so q-2k = 3 or q-2k = 1, in both case (p,q,k) = (5,3,1)

So answer = 3 2 + × 35 + 5 2 3^{2}+\times{3}{5}+5^{2} = 49

Mark Hennings
May 20, 2014

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

Edwin Ma
May 20, 2014

p 2 + p q + q 2 = k 2 ( p + q k ) ( p + q + k ) = p p^2+pq+q^2=k^2 \rightarrow (p+q-k)(p+q+k)=p . Assume WLOG p q p \geq q . Since p p & q q are both primes and p + q + k p + q k p+q+k \geq p+q-k we have that either p + q k = p p+q-k=p & p + q + k = q p+q+k=q or p + q k = 1 p+q-k=1 & p + q + k = p q p+q+k=pq . The first case gives us that p = k p=-k which is a contradiction as both p p and k k are positive integers. The second case gives us that p + q + k = p q ( p 1 ) ( q 1 ) = k + 1 p+q+k=pq \rightarrow (p-1)(q-1)=k+1 and p + q k = 1 p + q = k + 1 p+q-k=1 \rightarrow p+q=k+1 . Solving for q 1 q-1 , we get that ( p 1 ) ( q 1 ) = p + q q 1 = p + 1 p 2 (p-1)(q-1)=p+q \rightarrow q-1=\frac{p+1}{p-2} . Thus ( p 1 ) ( q 1 ) = k + 1 ( p 1 ) ( p + 1 p 2 ) = k + 1 (p-1)(q-1)=k+1 \rightarrow (p-1)(\frac{p+1}{p-2})=k+1 . Since p 1 p-1 and p 2 p-2 differ by one, they are relatively prime. Thus p 2 p + 1 p-2|p+1 . Since p 2 p-2 must divide p + 1 p+1 and they differ by 3 3 and p 2 0 p-2\ge 0 , p 2 p-2 must equal 3 3 . This means that p = 5 p=5 and k 2 = 49 k^2=49 .

Nishant Sharma
May 20, 2014

Let p 2 + q 2 + p q p^{2} + q^{2} + pq = n 2 n^{2} -------( \ast ) for some positive integer, n n .

From ---( \ast ) we manipulate as ( p + q ) 2 p q {(p + q)}^{2} - pq = n 2 n^{2}

or ( p + q ) 2 n 2 {(p + q)}^{2} - n^{2} = p q pq

or ( p + q + n ) (p + q + n) ( p + q n ) (p + q - n) = p q pq

Now, since p p and q q are primes cases are:

(i) ( p + q + n ) (p + q + n) = p p and ( p + q n ) (p + q - n) = q q , which implies p + q p + q = 0 0 which is impossible,

(ii) ( p + q + n ) (p + q + n) = q q and ( p + q n ) (p + q - n) = p p , which is similar to (i), so ruled out,

(iii) ( p + q + n ) (p + q + n) = p q pq and ( p + q n ) (p + q - n) = 1 1 ( \big( this is equivalent to saying that ( p + q + n ) (p + q + n) = 1 1 and ( p + q n ) (p + q - n) = p q pq ) \big) ,adding the two we get

2 p + 2 q 2p + 2q = 1 + p q 1 + pq

or ( p 2 ) (p - 2) ( q 2 ) (q - 2) = 3 3

or ( p 2 ) (p - 2) = 3 3 and ( q 2 ) (q - 2) = 1 1

or ( p , q ) (p,q) = ( 5 , 3 ) (5,3) and vice-versa

Plugging in ( p , q ) (p,q) = ( 5 , 3 ) (5,3) in eqn-( \ast ), we find n 2 n^{2} = 5 2 + 5 5^{2} + 5 × \times 3 + 3 2 3 + 3^{2} = 5 5 × \times ( 5 + 3 ) (5 + 3) + 3 2 3^{2} = 40 40 + 9 9 = 49 \boxed{49} which is our answer.

Suppose p 2 + p q + q 2 = k 2 p^{2}+pq+q^{2}=k^{2} , wheere k k is positive integer,then ( p + q ) 2 p q = k 2 (p+q)^{2} -pq =k^{2} \\ ( p + q ) 2 k 2 = p q ( p + q + k ) ( p + q k ) = p q (p+q)^{2}-k^{2} =pq \rightarrow (p+q+k)(p+q-k)=pq \\ , \\ we know that R H S 0 RHS\geq0 and L H S 0 LHS\geq0 \\ ( p + q k ) 0 (p+q-k)\geq0 And,since p + q + k p + q p q p+q+k \geq p+q\mid pq ,then p + q + k = p q p+q+k=pq since p + q + k p p+q+k\geq p and q q .So, we can obtain p + q k = 1 k = p + q 1 p+q-k=1 \rightarrow k=p+q-1\\ from that we can get p + q + ( p + q 1 ) = p q p+q+(p+q-1)=pq \\ ( p 2 ) ( q 2 ) = 3 (p-2)(q-2)=3\\ ( p . q ) = ( 5 , 3 ) o r ( 3 , 5 ) (p.q)=(5,3) or (3,5)\\ we can obtain that p 2 + q 2 + p q = 3 2 + 5 2 + 3.5 = 49 p^{2}+q^{2}+pq=3^{2}+5^{2}+3.5=49

Alex Yu
May 20, 2014

Let said perfect square be represented by a 2 a^2 , where a 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 p^2+pq+q^2 = (p+q)^2-pq = a^2 \implies (p+q-a)^2 = pq Since p q pq can only be factored in two ways ( p , q p, q or 1 , p q 1, pq ) due to p q pq being a product of only two primes, we have two possible cases:

Case 1: p + q a = p , p + q + a = q p+q-a = p, p+q+a=q (assuming wlog that p < q p<q ) Simplifying leads to the reduced equations q = a q=a and p = a p=-a , a contradiction, since p p must be positive. So this case cannot happen.

Case 2: p + q a = 1 , p + q + a = p q p+q-a = 1, p+q+a=pq From the first equation we have p + q = a + 1 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 pq-p-q=a \implies (p-1)(q-1) = pq-p-q+1 = a+1 However, since p + q = a + 1 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 p+q = (p-1)(q-1) \implies p+q = pq-p-q+1 \implies pq-2p-2q+4=3 \implies (p-2)(q-2) = 3 Since the only way to factor 3 is into 1 , 3 1, 3 , we must have p 2 = 3 , q 2 = 1 p-2=3, q-2=1 (or the other way around), which results in p = 5 , q = 3 p=5, q=3 . Then a 2 = p 2 + p q + q 2 = 25 + 15 + 9 = 049 a^2=p^2+pq+q^2 = 25+15+9 = \boxed{049} .

Abhishek Rawat
Jul 21, 2013

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

Ang Yan Sheng
Jul 20, 2013

Without loss of generality assume that p q p\leq q .

Let p 2 + p q + q 2 = ( p + k ) 2 p^2+pq+q^2=(p+k)^2 , where k k is a positive integer. Now if k q k\geq q then p 2 + p q + q 2 = ( p + k ) 2 ( p + q ) 2 = p 2 + 2 p q + q 2 p^2+pq+q^2=(p+k)^2\geq(p+q)^2=p^2+2pq+q^2 , or p q 0 pq\leq0 , contradiction. Hence 0 < k < q 0<k<q , so q k q\nmid k .

From p 2 + p q + q 2 = ( p + k ) 2 p^2+pq+q^2=(p+k)^2 we get ( p + q ) q = ( 2 p + k ) k (p+q)q=(2p+k)k . Since q k q\nmid k , we have q 2 p + k q|2p+k . But 0 < 2 p + k < 2 q + q = 3 q 0<2p+k<2q+q=3q , so either 2 p + k = q 2p+k=q or 2 p + k = 2 q 2p+k=2q .

If 2 p + k = q 2p+k=q then p 2 + p q + q 2 = ( p + k ) 2 = ( q p ) 2 = p 2 2 p q + q 2 , p^2+pq+q^2=(p+k)^2=(q-p)^2=p^2-2pq+q^2, so p q = 0 pq=0 , contradiction.

If 2 p + k = 2 q 2p+k=2q then p 2 + p q + q 2 = ( p + k ) 2 = ( 2 q p ) 2 = p 2 4 p q + 4 q 2 , p^2+pq+q^2=(p+k)^2=(2q-p)^2=p^2-4pq+4q^2, so 4 q 2 4 p q = p q + q 2 4q^2-4pq=pq+q^2 . Factoring out q q and rearranging terms, we get 3 q = 5 p 3q=5p . Thus 3 p 3|p and 5 q 5|q , so ( p , q ) = ( 3 , 5 ) (p,q)=(3,5) , and thus p 2 + p q + q 2 = 9 + 15 + 25 = 49 p^2+pq+q^2=9+15+25=49 .

Since 49 is the only square of the form p 2 + p q + q 2 p^2+pq+q^2 with p , q p,q prime, the answer is 49 \boxed{49} .

Michael Tang
Jul 20, 2013

Let x x be a positive integer. Then we have the equation p 2 + p q + q 2 = x 2 , p^2+pq+q^2 = x^2, or ( p + q ) 2 p q = x 2 . (p+q)^2-pq = x^2. Rearranging this, we get ( p + q ) 2 x 2 = p q , (p+q)^2-x^2 = pq, and by difference of squares, ( p + q + x ) ( p + q x ) = p q . (p+q+x)(p+q-x) = pq. Without loss of generality, let p q . p \ge q. Also notice that p + q + x > p + q x p+q+x > p+q-x because x x is positive. Because p p and q q are primes, the only possible factor pairs are p , q p, q and 1 , p q , 1, pq, so we have the cases p + q + x = p , p+q+x = p, p + q x = q , p+q-x = q, and p + q + x = p q , p+q+x = pq, p + q x = 1. p+q-x=1. Taking the first equation of the first case, we see that q + x = 0 , q+x = 0, which is impossible because both q q and x x are positive.

Taking the second case, we add the two given equations to get 2 p + 2 q = p q + 1 2p+2q = pq+1 p q 2 p 2 q + 1 = 0 pq - 2p - 2q +1=0 ( p 2 ) ( q 2 ) = 3 (p-2)(q-2) = 3 So, p 2 = 3 p-2=3 and q 2 = 1 , q-2=1, hence p = 5 , q = 3. p = 5, q = 3. Substituting into the equation p 2 + p q + q 2 = x 2 , p^2+pq+q^2=x^2, we get x 2 = 5 2 + 5 ( 3 ) + 3 2 = 49. x^2 = 5^2 + 5(3) + 3^2 = 49. Thus, the answer is 49 . \boxed{49}.

Abhishek Pushp
Jul 20, 2013

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

Rajat Garg
Jul 19, 2013

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

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...