Let a 0 , a 1 , ⋯ , a 7 be any 8 distinct integers. Let P be the product of their pairwise differences, that is:
P = i < j ∏ ( a i − a j )
What is the greatest integer which always divides P ?
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.
Can you explain why 5^3 divides the product?
Log in to reply
Okay, consider the different remainders that an integer can give when it is divided by 5 , they are: ( 0 , 1 , 2 , 3 , 4 )
Our goal here is to minimize the power of 5 that divides the given product. As i have mentioned in my solution, this means that we have to select numbers a 0 , a 1 , ⋯ a 7 such that they don't give same remainder with 5
Now, you see we have a problem here, we can assign different remainder integers to the first 5 of a 0 , a 1 , ⋯ a 7 . But after that, we see that we are left with a 5 , a 6 , a 7 . We have already exhausted our set of different remainders, so now we have to assign numbers to a 5 , a 6 , a 7 , such that the power of 5 in the product is minimized. The lowest power of 5 occurs when the remainders given by a 5 , a 6 , a 7 are all mutually different. And since all the remainders have already been used once before in a 0 , . . . , a 4 , this means that for three different pairwise differences, 5 is a factor. This is also the minimum number of times 5 can occur. Therefore 5 3 must be a factor of the product.
Example:
Let's say we filled in our first five numbers like this : 1 , 2 , 3 , 4 , 5
Obviously, each give different remainder with 5 . Now, I leave it to you as an exercise to see for yourself, that adding three more numbers into this set will guarantee you a 5 3 in the product.
1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 → 6 − 1 = 5 , 7 − 2 = 5 , 8 − 3 = 5
1 , 2 , 3 , 4 , 5 , 9 , 1 0 , 1 2 → 1 2 − 2 = 1 0 , 1 0 − 5 = 5 , 9 − 4 = 5
Log in to reply
oh...nice solution!!! can you prove that the "lowest power of 5 occurs when the remainders given by a5, a6 and a7 are different" though? thanks!!!
Not quite. The argument for 2 is much more subtle. For example, following your comment, we consider the different remainders that an integer can give when divided by 2. If there are 4 odd, and 4 even, then the number of powers of 2 that we can get is ( 2 4 ) + ( 2 4 ) = 6 + 6 = 1 2 . However, we need 2 1 6 .
Log in to reply
But actually, at least four of these numbers must be divisible by 4 . So we get 2 1 6 . Looks like we have to consider powers of prime factors also. I omitted this in the solution.
Log in to reply
Right. Please add that into your solution, and explain why / how.
Log in to reply
@Calvin Lin – Have made few changes. Blackout at my locality, running on UPS, do not know how much battery will last. Thank you for your comments and advice.
Log in to reply
@Raghav Vaidyanathan – I hope you survive the blackout! For me, that's one of the most irritating things to occur. Go sleep!
I agree with what you added, but that's because I already know the solution. Otherwise, it would be hard for someone who hasn't solved this problem to understand what you mean.
Can you think about how to improve the phrasing of the solution and then edit it tomorrow? Thanks!
Since the problem did not state that the 8 integers were distinct, can we not have the product of the differences equal to zero?
Log in to reply
Yes we can. 0 is divisible by every integer.
Log in to reply
But the problem asks for a number that divides P, and you can’t divide a number by 0, so no.
Log in to reply
@Philip Suskin – Be careful with the semantics.
"0 is divisible by every integer." -> For example, 0 is divisible by 2, since
2
0
=
0
.
"you can’t divide a number by 0" -> For example, 2 is not divisible by 0, since
0
2
is undefined.
So, both Philip and Raghav's statements are true, but they are talking about different things.
Nice solution. Made a mistake in the 2 's case.
There are a few nice tricks involved in this problem.
If we let a i = i , then we get that P = 1 2 5 4 1 1 3 2 8 0 0 0 , which gives us an upper bound on the answer. The challenge is to show that this is indeed the solution.
Observe that 1 2 5 4 1 1 3 2 8 0 0 0 = 2 1 6 × 3 7 × 5 3 × 7 1 . We will work via the prime factors.
The cases of p = 3 , 5 , 7 are much easier, and we will do them together. For each set of a i , let b 1 be the number of a i which leave a remainder of i when divided by p . Similarly, define b 2 , … b p .
Then, let s p = ( 2 b 1 ) + ( 2 b 2 ) + … ( 2 b p ) . We clearly have p s p ∣ P .
How do we minimize s p subject to ∑ b i = 8 ? Well, by Jensens's inequality, since ( 2 b ) = 2 1 × b × ( b − 1 ) is a quadratic, hence the minimum occurs when all of them are equal. However, this is not great, because it would give us a non-integer value of s p . Instead, we use a method called smoothing , to show that s p is minimized when all of the b i values differ by at least 1. In particular, we have
s 7 = ( 2 1 ) + ( 2 1 ) + ( 2 1 ) + ( 2 1 ) + ( 2 1 ) + ( 2 1 ) + ( 2 2 ) = 1 s 5 = ( 2 1 ) + ( 2 1 ) + ( 2 2 ) + ( 2 2 ) + ( 2 2 ) = 3 s 3 = ( 2 3 ) + ( 2 3 ) + ( 2 2 ) = 7
Now, if we tried the same for p = 2 , we will simply get s 2 = ( 2 4 ) + ( 2 4 ) = 1 2 . However, we need 2 1 6 ∣ P , instead of just 2 1 2 . How do we account for the additional powers of 2? Those arise when 4 ∣ a i − a j , where we would only have counted them once, but they should yield 2 to the count.
As such, we use the trick of "counting the total powers of 2, by counting each contribution once". For example, when finding the number of powers of 2 in 1 0 0 ! , we take ⌊ 2 1 0 0 ⌋ + ⌊ 4 1 0 0 ⌋ + ⌊ 8 1 0 0 ⌋ + ⌊ 1 6 1 0 0 ⌋ + … . This way, the contribution of 24 to the power of 2 comes in 3 places, namely ⌊ 2 1 0 0 ⌋ , ⌊ 4 1 0 0 ⌋ , ⌊ 8 1 0 0 ⌋ .
So, let's count the number of " 2 2 terms" which will appear. By the above argument, we have
s 4 = ( 2 2 ) + ( 2 2 ) + ( 2 2 ) + ( 2 2 ) = 4 .
Hence, the number of powers of 2 will be s 2 + s 4 = 1 6 . Thus, we can conclude that 2 1 6 ∣ P .
Now, can you generalize to the case of n integers? Be careful about when we have to use the "2" trick, and when the simple cases of "3, 5, 7" will work. How do you know?
Indeed. Personally I didn't suspect, until the end, that the answer was actually just the P value obtained by taking a i = i .
Without posting my full solution (which would be somewhat redundant at this point) I'd like to contribute a couple comments.
I think it is helpful to define E ( p , k ) (or whatever notation you prefer) to mean the number of pairs ( a i , a j ) that are congruent m o d p k , ( p prime, k any whole number) and E ( p ) = E ( p , 1 ) + E ( p , 2 ) + . . . . In other words, P = 2 E ( 2 ) 3 E ( 3 ) 5 E ( 5 ) . . .
Second comment is that the claim that the answer is the P value obtained by taking a i = i (namely, 1!2!3!4!5!6!7!) only requires that this selection minimizes each E ( p ) , but in fact it also minimizes each individual E ( p , k ) , which simplifies the task even more (especially if we are interested in generalizing it). It just boils down to the fact that E ( p , k ) is minimized when (to borrow your notation) all of the b i values differ by at most 1.
Log in to reply
Unfortunately, the claim in the second comment of
Given a polynomial with integer coefficients f ( x i ) , then the GCD of the values taken at integer points is equal to the minimum positive value of f ( x i ) (or even the minimum non-zero value of ∣ f ( x i ) ∣ .
is not true. (Specifically, the general case doesn't work for a general polynomial. The statement is still true for polynomials of the form in the question, but for a completely different reason)
As an explicit counter example, consider f ( x ) = x 2 − 4 . Then, the minimum positive value is f ( 3 ) = 5 , the minimum positive absolute value is ∣ f ( 1 ) ∣ = 3 , and it is clear that the GCD of this sequence is just 1.
Log in to reply
Thanks for that reply. I believe you're referring to a different problem, but I don't know which one (probably one I haven't read yet -- I haven't been spending a whole lot of time on this site recently).
I'm serious about not knowing why this works.
A more serious answer can probably be found in Professor Bhargava's article . (Theorem 3)
However the following code does a good job of showing that it works.
Mathematica Code:
1 2 3 |
|
So, the answer is actually
1 |
|
It's just pigeonhole principle. For example, it is easy to show that 7 ∣ P , and then it requires a bit of work to show that 5 3 ∣ P .
Then, think why we must have
3
7
∣
P
.
Hint: If we place 8 balls in 3 bins, what is the minimum number of (unordered) pairs of balls, such that each both balls are in the same bin?
Do the same with 2 .
And once that is done, generalize. In particular, prove that the answer is of the form ∏ i ! .
Log in to reply
One can prove the generalization using Vandermonde matrix.
Log in to reply
Could you add your solution? That would be a nice interpretation of ∏ ( x i − x j ) :)
Note that a − b ≡ 0 ( m o d n ) ⟹ a ≡ b ( m o d n ) .
We can ignore negative integer factors of P because we are looking for the largest number which always divides P .
For n = k , there are k possible equivalencies ( m o d k ) , namely 0 , 1 , . . . k − 1 . Since there are 8 integers a 0 ≤ i ≤ 7 , if k ≥ 8 , there are always enough possible equivalencies that each a 0 ≤ i ≤ 7 can be unique ( m o d k ) . However, when k < 8 , there are not enough equivalencies so that each integer a 0 ≤ i ≤ 7 can be unique ( m o d k ) . This involves the Pigeonhole Principle, which indicates that there are at least 8 − k duplicates, i.e. at least 8 − k pairs of integers such that a i ≡ a j ( m o d k ) ⟹ k ∣ ( a i − a j ) . P has 8 − k factors of k , so k 8 − k divides P . This is true for all k < 8 .
Then, P is always divisible by k = 1 ∏ 7 k 8 − k = k = 1 ∏ 7 k ! = 1 2 5 4 1 1 3 2 8 0 0 0
This can be easily generalized for m integers a 0 ≤ i ≤ m − 1 , using the same argument as above: P is always divisible by k = 1 ∏ m − 1 k m − k = k = 1 ∏ m − 1 k !
This solution makse a common error of modular arithemtic. If we have N ≡ 0 ( m o d a ) and N ≡ 0 ( m o d b ) , does it imply that N ≡ 0 ( m o d a b ) ?
Not necessarily, as in the case of a = b = N = 2 , and we clearly do not have 2 ≡ 0 ( m o d 4 ) .
The conclusion that we can draw is N ≡ 0 ( m o d g cd ( a , b ) ) . Unfortunately, this isn't strong enough to complete the solution.
Problem Loading...
Note Loading...
Set Loading...
Okay, let's see.
Thing to understand 1: If two integers a , b give the same remainder when divided by another integer n . Then a − b is divisible by n .
First we try to minimize the size of the prime factors(and also their powers) that can come up while taking differences For example, 1 1 may come up, but it isn't necessary. If we write 8 numbers, all of which give different remainders with 1 1 , we can see that 1 1 will not be a factor in our product. The same argument can be applied to all primes and prime powers greater than 1 1 to understand that these are not necessarily a factor of our product.
Now let us come to 7 . We want to find out the minimum number of times that 7 can occur. Consider the remainders given by numbers when divided by 7 : ( 0 , 1 , 2 , 3 , 4 , 5 , 6 ) . Now, we take seven numbers, each giving a different remainder with seven and make our set. What will we do for the eighth number? A little thinking tells us that we have to choose a number which gives remainder same as one of the numbers we have chosen earlier. This means that 7 must be a factor of the product of differences. And 7 1 is the largest power of seven that must necessarily be present in all products.
This logic or way of thinking is called pigeonhole principle. Where the numbers a 0 , a 1 , ⋯ a 7 can be thought of as pigeons, and the remainders given by these numbers when divided by a prime are the holes. We have to map each pigeon to a hole.
Similar arguments can be applied for each of the primes 5 , 3 , 2 to see that:
5 3 must be a factor.(refer comments for explanation)
3 7 must be a factor.
2 1 6 must be a factor. Explanation: If we proceed using similar arguments as in the case for 5 , we will get that 2 1 2 is a sure divisor of our product. But there is a catch here. It turns out that this is not the largest power of two that divides all products. This arises due to the fact that a few numbers in the product are divisible by 4 (this is the only prime power which is present in the given range). So we proceed with 4 as we did with the other prime factors, and see that four of the even numbers we counted are actually divisible by 4 , hence, we can further push up the power of two to 2 1 6
Hence the product is always divisible by 2 1 6 3 7 5 3 7 1 = 1 2 5 4 1 1 3 2 8 0 0 0
Otherwise, you can just go with your intuition and take eight consecutive numbers like 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 and you are done!
Thank you.