Perfect Trinomial Square

For distinct positive integers a a and b , b, we know that a 2 + 2 a b + b 2 a^2 + 2ab + b^2 is a perfect square. But what is the smallest possible value of a + b a + b for which a 2 + 3 a b + b 2 a^2 + 3ab + b^2 is a perfect square?


The answer is 10.

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.

5 solutions

We require that a 2 + 3 a b + b 2 = n 2 a^{2} + 3ab + b^{2} = n^{2} for some positive integer n n . Rewriting this equation as

a 2 + 3 b a + ( b 2 n 2 ) = 0 a^{2} + 3b*a + (b^{2} - n^{2}) = 0 , we see that

a = 3 b ± 9 b 2 4 ( b 2 n 2 ) 2 = 3 b ± 5 b 2 + 4 n 2 2 a = \dfrac{-3b \pm \sqrt{9b^{2} - 4(b^{2} - n^{2})}}{2} = \dfrac{-3b \pm \sqrt{5b^{2} + 4n^{2}}}{2} .

Now since we want a a to be a positive integer we will take the positive root and require that

5 b 2 + 4 n 2 = m 2 5b^{2} + 4n^{2} = m^{2} for some positive integer m m . This last equation can then be written as

5 b 2 = m 2 ( 2 n ) 2 = ( m 2 n ) ( m + 2 n ) . 5b^{2} = m^{2} - (2n)^{2} = (m - 2n)(m + 2n).

Now as 5 5 is prime it must divide at least one of m 2 n m - 2n or m + 2 n m + 2n , and since we are looking for the smallest possible value of a + b a + b we will want to minimize m m and n n as well. With this in mind, we can try setting m 2 n = 5 m - 2n = 5 and m + 2 n = b 2 m + 2n = b^{2} and add these two equations, which yields 2 m = b 2 + 5 2m = b^{2} + 5 . Since 2 m 2m is even we will require that b b is odd.

Checking successive odd integers, we obtain the following results:

  • b = 1 m = 3 a = 0 b = 1 \Longrightarrow m = 3 \Longrightarrow a = 0 : discard

  • b = 3 m = 7 a = 1 b = 3 \Longrightarrow m = 7 \Longrightarrow a = -1 : discard

  • b = 5 m = 15 a = 0 b = 5 \Longrightarrow m = 15 \Longrightarrow a = 0 : discard

  • b = 7 m = 27 a = 3 a + b = 10 b = 7 \Longrightarrow m = 27 \Longrightarrow a = 3 \Longrightarrow a + b = 10

  • b = 9 m = 43 a = 8 a + b = 17 b = 9 \Longrightarrow m = 43 \Longrightarrow a = 8 \Longrightarrow a + b = 17 .

Any larger values of b b will necessarily result in a value for a + b a + b in excess of 10 10 , so the minimum possible value for a + b a + b under the given conditions is 10 \boxed{10} .

@shithil Islam Nice problem. It is an interesting one to generalize, i.e., to find the minimum value for a + b a + b that makes a 2 + k a b + b 2 a^{2} + kab + b^{2} a perfect square for different values of k k , (other than 2 2 ). For k = 1 k = 1 I think the minimum is a + b = 3 + 5 = 8 a + b = 3 + 5 = 8 , and for k = 4 k = 4 I'm getting a + b = 4 + 5 = 9 a + b = 4 + 5 = 9 .

Brian Charlesworth - 5 years, 4 months ago

Log in to reply

Thank you so much.................

shithil Islam - 5 years, 4 months ago

Exactly Same Way.

Kushagra Sahni - 5 years, 4 months ago

The algorithm for computer or calculator is as under.
Set m=10, n=10, p=1. These values have to be increased if the answer is not obtained with in this limit. **........outer loop, b=p add 1 upto n. ...................inner loop, a=1 add 1 upto m. . . . . . . . . . . . . . . . . . . . . . . . . . x = a 2 + 3 a b + b 2 ...............................if x integer Print. ..................Next inner loop. ..........Next outer loop. ....... p=n: n=n+10 : End if n>100 Go to ** I have used this with TI-83 and got answer with a=3, and b=7. I went manually through 37 loop, changing a and b after a=10, to a=0 and b=b+1. My expression was to start, b=1, a=0. a + 1 S T R a : a 2 + 3 a b + b 2 stopped looping when saw the integer answer. \text{Set m=10, n=10, p=1.}\\ \text{ These values have to be increased if the answer is not obtained with in this limit.} \\ \text{**........outer loop, b=p add 1 upto n.}\\ \text{...................inner loop, a=1 add 1 upto m.}\\ .........................x=\sqrt{a^2+3ab+b^2}\\ \text{...............................if x integer Print.}\\ \text{..................Next inner loop.}\\ \text{..........Next outer loop.}\\ \text{....... p=n: n=n+10 : End if n>100 Go to **}\\ \text{I have used this with TI-83 and got answer with a=3, and b=7.} \\ \text{I went manually through 37 loop, changing a and b after a=10, to a=0 and b=b+1. }\\ \text{My expression was to start, b=1, a=0.}\\ a+ ~1 ~STR ~ a ~~{\Huge :}\sqrt{ a^2 +3ab+ b^2}\text{ stopped looping when saw the integer answer.} .

Joshua Chin
Feb 6, 2016

a 2 + 2 a b + b 2 = ( a + b ) 2 { a }^{ 2 }+2ab+{ b }^{ 2 }={ (a+b) }^{ 2 }

We let a 2 + 3 a b + b 2 = x 2 { a }^{ 2 }+3ab+{ b }^{ 2 }={ x }^{ 2 } and x is an integer.

Now we let the case that x = a + b + 1 x=a+b+1 . You can let x = a + b + n { x=a+b+n } where n is natural number, but for simplicity sake we put 1.

This becomes ( a + b + 1 ) 2 ( a + b ) 2 = a b { (a+b+1) }^{ 2 }-{ (a+b) }^{ 2 }=ab .

After simplification, 2 a + 2 b + 1 = a b 2a+2b+1=ab

a b 2 a 2 b 1 = 0 ( a 2 ) ( b 2 ) = 5 ab-2a-2b-1=0\\ (a-2)(b-2)=5

a 2 = 5 o r a 2 = 1 b 2 = 1 b 2 = 5 a-2=5\qquad \qquad or\qquad \qquad a-2=1\\ b-2=1\qquad \qquad \qquad \qquad \quad b-2=5

Both cases give a + b = 10 a+b=10

So a + b 10 a+b\ge 10

Moderator note:

You made the assumption that n = 1 n = 1 will lead to the smallest possible value of a + b a + b . This is not immediately obvious, nor necessarily true.

Instead, you should consider all possible solutions for n n , and find the minimum value of a + b a + b from there.

You made the assumption that n = 1 n = 1 will lead to the smallest possible value of a + b a + b . This is not immediately obvious, nor necessarily true.

Instead, you should consider all possible solutions for n n , and find the minimum value of a + b a + b from there.

Calvin Lin Staff - 5 years, 3 months ago
Bill Bell
Feb 29, 2016

This problem presents an interesting computational number theory challenge as an alternative solution. That is, how can you 'creep up' from below to find a minimum when two variables are involved. In this case, since we are interested only in a+b we can consider points in a lattice that is open to infinity and check for whether candidate values of the function are perfect squares using the Babylonian algorithm. It's the for-loop that walks through points in the lattice.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
from itertools import count

# from:
# http://stackoverflow.com/questions/2489435/how-could-i-check-if-a-number-is-a-perfect-square
def is_square(apositiveint):
    x = apositiveint // 2
    seen = set([x])
    while x * x != apositiveint:
        x = (x + (apositiveint // x)) // 2
        if x in seen: return False
        seen.add(x)
    return True

for a,b in ((a,b) for a in count(1) for b in range(1,a)):
    if is_square(a**2+3*a*b+b**2):
        print (a+b)
        break

Tom Engelsman
Feb 6, 2016

Taking a^2 + 3ab + b^2 = n^2, one can write (a+b)^2 + ab = n^2, or ab = [n+(a+b)][n-(a+b)] by the difference of two squares. Now set:

a = n + a + b (i)

b = n - a - b (ii)

which adding (i) with (ii) yields a + b = 2n (for positive integers n).

Now, we check ordered pairs (a,b) with distinct positive integers a < b and with trinomial value T = a^2 + 3ab + b^2:

n = 4: (a,b) = (1,3) => T = 19.

n = 6: (a,b) = (1,5) => T = 41; (a,b) = (2,4) => T = 44.

n = 8: (a,b) = (1,7) => T = 71; (a,b) = (2,6) => T = 76; (a,b) = (3,5) => T = 79.

n = 10: (a,b) = (1,9) => T = 109; (a,b) = (2,8) => T = 116; (a,b) = (3,7) => T = 121; (a,b) = (4,6) => T = 124.

The first and smallest perfect square occurs at (a,b) = (3,7), hence a + b = 10 is the smallest possible value under these conditions.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...