How many positive integers n ≤ 1 0 0 0 cannot be written in the form a 2 − b 2 − c 2 , where a , b and c are non-negative integers with a ≥ b + c ?
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.
Most solutions failed to check that a ≥ b + c .
Here a , b and c are all non-negative integers. Can we solve the same problem mathematically if a , b and c were positive integers ?
I will show that every integer can be written in the form a 2 − b 2 − c 2 by finding counterexamples for different cases.
CASE 1: n IS EVEN
In this case, let b = 1 , c = 2 n , and a = b + c . Then a 2 − ( b 2 + c 2 ) = ( b + c ) 2 − ( b 2 + c 2 ) = 2 b c = 2 ( 1 ) ( 2 n ) = n . Thus an ordered triplet ( a , b , c ) can be constructed for every even positive integer n .
CASE 2: n IS ODD
In this case, let c = 0 , so the statement in question reduces to a 2 − b 2 . In addition, let b = 2 n − 1 and a = b + 1 . Then a 2 − b 2 = ( b + 1 ) 2 − b 2 = 2 b + 1 = 2 ( 2 n − 1 ) + 1 = n . Hence an ordered triplet ( a , b , c ) can be constructed for every odd positive integer 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 .
n = a 2 − b 2 − c 2
a 2 − b 2 = n + c 2
( a + b ) ( a − b ) = n + c 2
If n + c 2 is odd, we can have ( a + b ) = n + c 2 and ( a − b ) = 1 .
So, one of the possible solution is
If n is odd, set c = 0 so that ( a + b ) = n and ( a − b ) = 1 . Solving this gives us a = 2 n + 1 and b = 2 n − 1 . Because n is odd, n + 1 and n − 1 will be even, so a and b will be integers. b + c = 2 n − 1 ≤ a . And because n ≥ 1 , all values of a , b , and c will be positive. So with an odd n, this solution always meets the requirement of the problem.
If n is even, set c = 1 . ( a + b ) = n + 1 and a − b = 1 . Solving this gives us a = 2 n + 2 and b = 2 n . Because n is even, n + 2 will be even too. So, a and b will both be integers. b + c = 2 n + 2 ≤ a . Because n is positive, the values of a , b , and c will all be positive.So with an even 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 . So, the number of positive integers that cannot be written in the form a 2 − b 2 − c 2 is 0.
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.
If we let ( a , b , c ) = ( k + 1 , k , 0 ) for any integer k , then a 2 − b 2 − c 2 = ( k + 1 ) 2 − k 2 − 0 = 2 k + 1 (i.e. any odd number).
If we let ( a , b , c ) = ( k + 1 , k , 1 ) for any integer k , then a 2 − b 2 − c 2 = ( k + 1 ) 2 − k 2 − 1 2 = 2 k (i.e. any even number).
Hence, all integers can be written in the form a 2 − b 2 − c 2 , which shows the answer is 0 .
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.
First, we note that for a , b and n such that a 2 − b 2 = n has integer solutions for a and b if and only if n is odd or is a multiple of 4. This can be shown easily since a 2 − b 2 = ( a + b ) ⋅ ( a − b ) and if a + b = c 1 and a − b = c 2 , where c 1 and c 2 are integers with product n , then a = 2 c 1 + c 2 and b = 2 c 1 − c 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 .
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 .
In conclusion, all integers n can be expressed as a 2 − b 2 − c 2 .
Assume that a = b + c . If so, then the a 2 − b 2 − c 2 is equal to 2 b c , so any even number can be written of this form. Now write 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 , 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 ". It is a necessary condition that 2 b c 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".
a
=
b
+
c
+
t
n
=
t
2
+
2
(
b
+
c
)
t
+
2
b
c
For
t
=
0
,
c
=
1
⟹
n
=
2
b
which means n can be any even integer.
For
t
=
1
,
c
=
0
⟹
n
=
2
b
+
1
which means n can be any odd integer.
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
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
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.
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
Problem Loading...
Note Loading...
Set Loading...
If n is odd, then n = 2 k + 1 for a non-negative integer k . Let a = k + 1 , b = k , c = 0 , then a 2 − b 2 − c 2 = 2 k + 1 .
If n is even, then n = 2 k for a positive integer k . Let a = k + 1 , b = k , c = 1 , then a 2 − b 2 − c 2 = 2 k .
Hence all positive integers can be written in the form a 2 − b 2 − c 2 where a , b , c are non-negative integers subject to a ≥ b + c .
[Latex edits - Calvin]