A Number Theory Thing

How many positive integer solutions ( a , b ) (a, b) does the equation a 2 + b 2 + ( a + b ) 2 = b 3 a^2+b^2+(a+b)^2=b^3 have, where 0 < b < 2017 ? 0<b<2017?


The answer is 31.

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.

6 solutions

Mark Hennings
Oct 8, 2017

The equation can be written as ( 2 a + b ) 2 = b 2 ( 2 b 3 ) (2a+b)^2 \; = \; b^2(2b-3) so we require 2 b 3 = ( 2 n + 1 ) 2 2b-3 = (2n+1)^2 to be an odd perfect square. Thus we need b = 2 ( n 2 + n + 1 ) a = n b b \; = \; 2(n^2 + n + 1) \hspace{2cm} a \; = \; nb and since a , b 1 a,b \ge 1 and b < 2017 b <2017 we deduce that 1 n 31 1 \le n \le 31 . Thus there are 31 \boxed{31} solutions.

Why do we require for ( 2 b 3 ) (2b-3) to be an odd perfect square? Why not even? And I think you should elaborate more on why do you rearrange the equation like that?

Stojan Samojlovski - 3 years, 7 months ago

Log in to reply

I have shown that the integer 2 b 3 2b-3 is a rational square, hence an integer square. Since 2 b 3 2b-3 is odd, it must be an odd square.

Mark Hennings - 3 years, 7 months ago

Log in to reply

Can you explain more about how you got a = n b a = nb . And how you deduced about n n that is less than 31 31

Stojan Samojlovski - 3 years, 7 months ago

Disprove my statement or agree that the question is wrong

Ariijit Dey - 3 years, 7 months ago

Log in to reply

I just did disprove it. I am not saying that b b is odd. I am saying that 2 b 3 2b-3 is odd.

Mark Hennings - 3 years, 7 months ago

You can arrive to the same conclusion by solving the original equation as quadratic equation with parameter b. As b must be even and a=b/2(-1 + (2b-3)^(1/2)), 2b-3 must be an odd perfect square.

Mirek Baudys - 3 years, 7 months ago

Log in to reply

a variant is 2a^2 + 2b^2 + 2ab = b^3 , and by dividing by b2 we conclude that --> a^2 +2ab = kb^2, otherwise it will have intenger vs. rational in equality. k cannot be positive, unless 0 or 1. for k negative (k+1) must be a square otherwise the solution of the last second degree equation will not have solution ... so we count. Anyway, thumbs up for Laszlo Mihalyi

Octavian Popescu - 3 years, 7 months ago

I didn't get this Re write the equation as 2(a+b)^2 =b^3 +2ab

If be is odd perfect square then the Right side is odd but the LHS is even...😵😵😵

Ariijit Dey - 3 years, 7 months ago

Log in to reply

2 b 3 2b-3 must be odd, but if you follow the argument through, it turns out that b = 2 ( n 2 + n + 1 ) b = 2(n^2+n+1) must be even.

Mark Hennings - 3 years, 7 months ago
Laszlo Mihaly
Oct 16, 2017

If we re-arrange the equation we get 2 ( a 2 + b 2 + a b ) = b 3 2(a^2+b^2+ab)=b^3 , so b b must be even. Let us make the substitution: a = x m a=xm and b = 2 m b=2m , where m m is integer. From the original equation we have a new one, x 2 ( 1 + x 2 ) + 1 = m \frac{x}{2}\left(1+\frac{x}{2}\right) +1 =m . We see that for m m to be an integer, x x has to be an even integer (this follows from x 2 ( 1 + x 2 ) = m 1 = i n t e g e r \frac{x}{2}\left(1+\frac{x}{2}\right)=m-1=integer ), so x = 2 n x=2n , m = n 2 + n + 1 m=n^2+n+1 and b = 2 ( n 2 + n + 1 ) b=2(n^2+n+1) . Starting from n = 1 n=1 we have to go up to n = 32 n=32 to get a b > 2017 b>2017 . There are 31 solutions.

Stephen Weinberg
Oct 15, 2017

Cheater's solution:

First we need to solve for a a . Since we are cheaters and don't actually know math, this is easiest to do using wolfram alpha: like so

As we can see, a = 1 2 ( b 2 ( 2 b 3 ) b ) a = {1\over{2}} (\sqrt{b^2 (2b-3)}-b) . But wait, what about the other solution? Well... that other solution will never give us a positive integer, so we can safely ignore it.

So, now that we know a a and we have a reasonable number of possible b values, we can write a program to find the b values that give us a.

The following code outputs 31 31 .

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
from decimal import Decimal, InvalidOperation

# Given b, compute a without any floating point errors. It is unlikely that
# floating point would cause a problem, but it is best practice to avoid it if
# you can.
def f(b):
  b = Decimal(b)
  try:
    return ((b**2 * (2*b-3)).sqrt() - b) / 2
  except InvalidOperation:
    # Probably tried to find the sqrt of a negative number.
    return None

answers = []
for b in xrange(1, 2017):
  a = f(b)
  # If a is a positive integer, add to list of answers.
  if a != None and a > 0 and a == int(a):
    answers.append((a, b))

print len(answers)

Thanks pero pataka lang m,o!!

jazel libaton - 3 years, 7 months ago

Basically what I did, except in R.

Richard Desper - 3 years, 7 months ago
Antoine G
Oct 18, 2017

A direct and unrefined solution:

Expand: a 2 + b 2 + a 2 + 2 a b + b 2 = b 3 a^2 + b^2 + a^2 + 2ab+ b^2 = b^3

Gather and divide by 2: a 2 + a b + ( b 2 b 3 2 ) = 0 a^2 + ab + (b^2 - \frac{b^3}{2}) =0

Solve for a a : a = b ± 2 b 3 3 b 2 2 = b 2 ( ± 2 b 3 1 ) a = \frac{ - b \pm \sqrt{ 2b^3-3b^2} }{2} = \frac{b}{2} (\pm \sqrt{2b-3} -1 )

Since a a is positive, only + possible in ± \pm .

Hence 2 b 3 \sqrt{2b-3} is an integer > 1 >1 (if it equals 1 then a = 0 a=0 ).

n = 2 b 3 b = n 2 + 3 2 n = \sqrt{2b-3} \implies b = \frac{n^2+3}{2} .

Note that n n must be odd and 3 \geq 3 . This means b b will always be even (a odd square +3 is always divisible by 4) and hence b / 2 b/2 is always an integer. So these numbers (i.e. ( n 2 + 3 4 ( n + 1 ) , n 2 + 3 2 ) \big( \frac{n^2+3}{4} (n+1), \frac{n^2+3}{2} \big) ) are exactly the integral positive solutions.

Look what is the largest n n : n 2 + 3 2 < 2017 n 2 2017 3 63.5 \frac{n^2+3}{2} < 2017 \implies n \leq \sqrt{2 \cdot 2017 -3 } \approx 63.5

There are 31 odd numbers between 3 and 63. So the answer is 31.

Vijay Neelakantan
Oct 20, 2017

We have 2 (a^2 + b^2 +ab) = b^3. This means b has to be an even number. Let b be 2N. Solving the quadratic equation in a, we get a^2+2Na +(4N^2 -4N^3) = 0. This yields, a = -N + N sqrt(4N-3), taking only the positive values of a. Since a is a positive integer, 4N-3 has to be a perfect square. Let 4N-3 = K^2. Knowing that 0<N<=1008, we see that K can be only up to 63. Also every 2nd value of K from 1 to 63, yields integer solutions. Also K =1 is not valid as that yields a = 0 which is not positive. Hence we conclude that we have (63-1)/2 = 31 distinct solutions.

Ariijit Dey
Nov 1, 2017

int main() { int a,b,x,y=0;

for(a=1;a<=201217;a++)

{

    for(b=1;b<2017;b++)

    {

        x=pow(a,2)+pow(b,2)+pow((a+b),2)-pow(b,3);

        if(x==0)
                     y++;
    }
}

cout<<"\n\n"<<y;

return 0;

}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...