Integers Equal to a Difference of Squares

Algebra Level 5

How many positive integers n 1000 n \leq 1000 cannot be written in the form a 2 b 2 c 2 a^2-b^2-c^2 , where a , b a, b and c c are non-negative integers with a b + c a \geq b + c ?


The answer is 0.

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.

13 solutions

Johan Chrisnata
May 20, 2014

If n n is odd, then n = 2 k + 1 n= 2k+1 for a non-negative integer k k . Let a = k + 1 , b = k , c = 0 a = k+1, b= k, c=0 , then a 2 b 2 c 2 = 2 k + 1 a^2 - b^2 - c^2 = 2k+1 .

If n n is even, then n = 2 k n = 2k for a positive integer k k . Let a = k + 1 , b = k , c = 1 a = k+1, b = k , c=1 , then a 2 b 2 c 2 = 2 k a^2 - b^2 - c^2 = 2k .

Hence all positive integers can be written in the form a 2 b 2 c 2 a^2 - b^2 - c^2 where a , b , c a,b,c are non-negative integers subject to a b + c a\geq b+c .

[Latex edits - Calvin]

Most solutions failed to check that a b + c a \geq b + c .

Calvin Lin Staff - 7 years ago

Here a , b a, b and c c are all non-negative integers. Can we solve the same problem mathematically if a , b a, b and c c were positive integers ?

Tejas Kasetty - 5 years, 5 months ago
David Altizio
May 20, 2014

I will show that every integer can be written in the form a 2 b 2 c 2 a^2-b^2-c^2 by finding counterexamples for different cases.

CASE 1: n n IS EVEN

In this case, let b = 1 , c = n 2 , b=1,c=\frac n2, and a = b + c a=b+c . Then a 2 ( b 2 + c 2 ) = ( b + c ) 2 ( b 2 + c 2 ) = 2 b c = 2 ( 1 ) ( n 2 ) = n . a^2-(b^2+c^2)=(b+c)^2-(b^2+c^2)=2bc=2(1)\left(\dfrac n2\right)=n. Thus an ordered triplet ( a , b , c ) (a,b,c) can be constructed for every even positive integer n n .

CASE 2: n n IS ODD

In this case, let c = 0 c=0 , so the statement in question reduces to a 2 b 2 a^2-b^2 . In addition, let b = n 1 2 b=\frac{n-1}2 and a = b + 1 a=b+1 . Then a 2 b 2 = ( b + 1 ) 2 b 2 = 2 b + 1 = 2 ( n 1 2 ) + 1 = n . a^2-b^2=(b+1)^2-b^2=2b+1=2\left(\dfrac{n-1}2\right)+1=n. Hence an ordered triplet ( a , b , c ) (a,b,c) can be constructed for every odd positive integer n n as well. Combining both of these cases, we see that all positive integers can be expressed this way, and the number of positive integers that can not be expressed as such is is 0 \boxed{0} .

Nathan Azaria
May 20, 2014

n = a 2 b 2 c 2 n = a^2 - b^2 - c^2

a 2 b 2 = n + c 2 a^2 - b^2 = n + c^2

( a + b ) ( a b ) = n + c 2 (a+b)(a-b) = n + c^2

If n + c 2 n+c^2 is odd, we can have ( a + b ) = n + c 2 (a+b) = n+c^2 and ( a b ) = 1 (a-b)=1 .

So, one of the possible solution is

  1. If n is odd, set c = 0 c=0 so that ( a + b ) = n (a+b) = n and ( a b ) = 1 (a-b) = 1 . Solving this gives us a = n + 1 2 a=\frac{n+1}{2} and b = n 1 2 b= \frac{n-1}{2} . Because n n is odd, n + 1 n+1 and n 1 n-1 will be even, so a a and b b will be integers. b + c = n 1 2 a b+c = \frac{n-1}{2} \leq a . And because n 1 n \geq 1 , all values of a a , b b , and c c will be positive. So with an odd n, this solution always meets the requirement of the problem.

  2. If n is even, set c = 1 c=1 . ( a + b ) = n + 1 (a+b) = n+1 and a b = 1 a-b = 1 . Solving this gives us a = n + 2 2 a = \frac{n+2}{2} and b = n 2 b=\frac{n}{2} . Because n n is even, n + 2 n+2 will be even too. So, a a and b b will both be integers. b + c = n + 2 2 a b+c = \frac{n+2}{2} \leq a . Because n n is positive, the values of a a , b b , and c c will all be positive.So with an even n n , this solution always meets the requirement of the problem.

From this it can be deduced that all positive integers can be written in the form a 2 b 2 c 2 a^2 - b^2 - c^2 . So, the number of positive integers that cannot be written in the form a 2 b 2 c 2 a^2 - b^2 -c^2 is 0.

Mike Yang
May 20, 2014

Consider this, all odd numbers can be written as the difference of consecutive squares:

(n)^2 - (n-1)^2 = n^2- (n^2-2n+1) = 2n-1, for all integers n >0, 2n-1 will be odd numbers.

Therefore, if a and b are consecutive integers: If c = 0, all odd numbers can be generated.

If c =1, all even numbers can be generated.

Therefore, 0 integers n cannot be written in the form a^2 - b^2 - c^2.

Didn't state that a \geq b+c

Calvin Lin Staff - 7 years ago
Calvin Lin Staff
May 13, 2014

If we let ( a , b , c ) = ( k + 1 , k , 0 ) (a, b, c) = (k+1, k, 0) for any integer k k , then a 2 b 2 c 2 = ( k + 1 ) 2 k 2 0 = 2 k + 1 a^2 - b^2 - c^2 = (k+1)^2 - k^2 - 0 = 2k + 1 (i.e. any odd number).

If we let ( a , b , c ) = ( k + 1 , k , 1 ) (a, b, c) = (k+1, k, 1) for any integer k k , then a 2 b 2 c 2 = ( k + 1 ) 2 k 2 1 2 = 2 k a^2 - b^2 - c^2 = (k+1)^2 - k^2 - 1^2 = 2k (i.e. any even number).

Hence, all integers can be written in the form a 2 b 2 c 2 a^2- b^2 - c^2 , which shows the answer is 0 0 .

Abhishek Thakur
May 20, 2014

given that a>=b+c. Case 1: let a = b+c. then a^2-b^2-c^2 = 2bc which is even. so every even no is expressible as this if we choose appropriate b and c. Case 2: let a>b+c ie let a=b+c+i where i=1,2,3..... then a^2-b^2-c^2 = 2(bc + bi +ci) + i^2. let i=1 therefore the equation now becomes a^2-b^2-c^2 = 2(bc + b+ c) + 1 which is always odd. so we can represent all odd no if we choose appropriate b and c. Therefore all the nos can be represented as a^2-b^2-c^2 where a>=b+c and so the answer to this question is 0.

Didn't explain what "appropriate b and c" is.

Calvin Lin Staff - 7 years ago
Jaren Sta Maria
May 20, 2014

First, we note that for a , b a, b and n n such that a 2 b 2 = n a^2-b^2=n has integer solutions for a a and b b if and only if n n is odd or is a multiple of 4. This can be shown easily since a 2 b 2 = ( a + b ) ( a b ) a^2-b^2 = (a+b)\cdot(a-b) and if a + b = c 1 a+b=c_1 and a b = c 2 a-b=c_2 , where c 1 c_1 and c 2 c_2 are integers with product n n , then a = c 1 + c 2 2 a=\frac{c_1+c_2}{2} and b = c 1 c 2 2 b=\frac{c_1-c_2}{2} , giving the above conclusion. Next, we note the following relationship: 2 ( 2 k 1 ) = 4 k 2 = ( 4 k 2 ) ( 4 k 2 4 k + 1 ) 1 = ( 2 k ) 2 ( 2 k 1 ) 2 1 2 . 2(2k-1)=4k-2=(4k^2)-(4k^2-4k+1)-1=(2k)^2-(2k-1)^2-1^2.

Applying this equation to all positive integers k, we have: 2 ( 1 ) = 2 2 1 2 1 2 , 2 ( 3 ) = 4 2 3 2 1 2 , 2 ( 5 ) = 6 2 5 2 1 2 2(1)=2^2-1^2-1^2, \\2(3)=4^2-3^2-1^2, \\2(5)=6^2-5^2-1^2 .

In conclusion, all integers n n can be expressed as a 2 b 2 c 2 a^2-b^2-c^2 .

Is the first paragraph necessary / relevant to the problem?

Does the second paragraph

Calvin Lin Staff - 7 years ago
Kevin Guo
Dec 28, 2016

Assume that a = b + c a=b+c . If so, then the a 2 b 2 c 2 a^2-b^2-c^2 is equal to 2 b c 2bc , so any even number can be written of this form. Now write a 2 b 2 a^2-b^2 as a difference of squares. If c is equal to 0, and a is 1 greater than b, then any odd number can also be written of this form. Since every single number can be written in the form a 2 b 2 c 2 a^2-b^2-c^2 , then the answer is 0 positive integers.

For completeness, it is best to be explicit about how "any even number can be written in the form 2 b c 2bc ". It is a necessary condition that 2 b c 2bc is even, but you have not shown yet that this is also sufficient . I agree the final step is somewhat obvious, which is why it is "for completeness of the solution".

Calvin Lin Staff - 4 years, 5 months ago
Shaurya Gupta
Nov 4, 2015

a = b + c + t a = b + c + t
n = t 2 + 2 ( b + c ) t + 2 b c n = t^2 + 2(b+c)t + 2bc
For t = 0 , c = 1 n = 2 b t=0, c=1 \implies n = 2b which means n can be any even integer.
For t = 1 , c = 0 n = 2 b + 1 t=1 , c=0 \implies n=2b+1 which means n can be any odd integer.


Nguyễn Anh
Oct 19, 2015

Since a >= b+c so we can assume that a = b+c+d (d >= 0)

Then S = a^2 - b^2 - c^2 = d^2 + 2d(b+c) + 2bc

Case 1: d=1, b=0 then we have S = 1 + 2c (c >= 0)

Therefore, we can conclude that all odd number can be written in the form a^2 - b^2 - c^2 (1)

Case 2: d=0, b=1 then we have S = 2c (c >= 0)

Therefore, we can conclude that all even number can be written in the form a^2 - b^2 - c^2 (2)

From (1) and (2), all positive integers can be written in the form a^2 - b^2 - c^2, where a,b,c are non-negative integers with a >= b+c

Yash Goyal
May 20, 2014

Given that: a>=b+c a^2>=(b+c)^2
(The sign of equality will remain same as a,b and c are non-negative numbers) a^2>=b^2+c^2+2bc a^2-b^2-c^2>=2bc n>=2bc (as "n" is in the form of a^2-b^2-c^2)

this equation will always follow for each and every positive value of "n" by keeping any of b or c or both equal to zero as b and c are non- negative integers (non-negative integers are those which include all positive numbers including zero)

so there will not be any integer n<=1000 which cannot be written in the form of a^2-b^2-c^2

The inequality has nothing to do with it.

Calvin Lin Staff - 7 years ago
Caetano Carezzato
May 20, 2014

It is easy to write a simple java program that will test all possibilies:

public class Brilhant {

public static void main(String[] args) {
    System.out.println("" + b2_2());
}

private static int b2_2() {
    int count = 0;
    for (int n = 0; n <= 1000; n++) {
        count += b2_2_aux(n) ? 0 : 1;
    }
    return count;
}

private static boolean b2_2_aux(int n) {
    for (int a = (int) Math.sqrt(n); a <= n; a++) {
        for (int b = 0; b <= a; b++) {
            for (int c = 0; c <= a - b; c++) {
                if (a * a - b * b - c * c == n && a >= b + c) {
                    System.out.println("" + n + " = " + a + "^2 - " + b + "^2 - " + c + "^2");
                    return true;
                }
            }
        }
    }
    return false;
}

}

Running the program we will see that all integers between 0 and 1000 can be written in the given form.

Adrian del Mundo
May 20, 2014

If you look closely, there is a pattern in the difference between consecutive squares

0,1,4,9,16,25... 0+1=1 1+3=4 4+5=9 9+7=16 16+9=25

Given this, we can see that a positive integer n can always be written as a^2-b^2-c^2.

If n is odd, just get the square with n as its difference to the previous square, and that will be your a^2, while your b^2 will be the square before it. If n is even, get the square with n+1 as its difference to the previous square, and that will be your a^2, while your b^2 and c^2 will be the square before it and 1. Order does not matter for b^2 and c^2.

For example: 26 Just get the square which has a difference of 25 to the previous square, and that will be your a^2. Use the formula of Arithmetic Sequences. [(25-1)/2]+3=13

So we have 13 as a, and 169 as a^2. Now we just use 25 and 1 as b^2 and c^2. Order doesn't matter. This way we will end up with 26.

169-25-1=26

I don't understand the 2nd part.

Calvin Lin Staff - 7 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...