This works - I don't know why

Let a 0 , a 1 , , a 7 a_0, a_1, \cdots, a_7 be any 8 8 distinct integers. Let P P be the product of their pairwise differences, that is:

P = i < j ( a i a j ) P = \prod _ {i < j} {(a_i - a_j)}

What is the greatest integer which always divides P ? P?


The answer is 125411328000.

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

Okay, let's see.

Thing to understand 1: If two integers a , b a,b give the same remainder when divided by another integer n n . Then a b a-b is divisible by n 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, 11 11 may come up, but it isn't necessary. If we write 8 8 numbers, all of which give different remainders with 11 11 , we can see that 11 11 will not be a factor in our product. The same argument can be applied to all primes and prime powers greater than 11 11 to understand that these are not necessarily a factor of our product.

Now let us come to 7 7 . We want to find out the minimum number of times that 7 7 can occur. Consider the remainders given by numbers when divided by 7 7 : ( 0 , 1 , 2 , 3 , 4 , 5 , 6 ) (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 7 must be a factor of the product of differences. And 7 1 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 a_0, a_1, \cdots 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 5,3,2 to see that:

5 3 5^3 must be a factor.(refer comments for explanation)

3 7 3^7 must be a factor.

2 16 2^{16} must be a factor. Explanation: If we proceed using similar arguments as in the case for 5 5 , we will get that 2 12 2^{12} 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 4 (this is the only prime power which is present in the given range). So we proceed with 4 4 as we did with the other prime factors, and see that four of the even numbers we counted are actually divisible by 4 4 , hence, we can further push up the power of two to 2 16 2^{16}

Hence the product is always divisible by 2 16 3 7 5 3 7 1 = 125411328000 2^{16}3^75^37^1=\boxed{125411328000}

Otherwise, you can just go with your intuition and take eight consecutive numbers like 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 1,2,3,4,5,6,7,8 and you are done!

Thank you.

Can you explain why 5^3 divides the product?

Agnishom Chattopadhyay - 6 years, 3 months ago

Log in to reply

Okay, consider the different remainders that an integer can give when it is divided by 5 5 , they are: ( 0 , 1 , 2 , 3 , 4 ) (0,1,2,3,4)

Our goal here is to minimize the power of 5 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 a_0, a_1, \cdots a_7 such that they don't give same remainder with 5 5

Now, you see we have a problem here, we can assign different remainder integers to the first 5 5 of a 0 , a 1 , a 7 a_0, a_1, \cdots a_7 . But after that, we see that we are left with a 5 , a 6 , a 7 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 a_5,a_6,a_7 , such that the power of 5 5 in the product is minimized. The lowest power of 5 5 occurs when the remainders given by a 5 , a 6 , a 7 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 a_0,...,a_4 , this means that for three different pairwise differences, 5 5 is a factor. This is also the minimum number of times 5 5 can occur. Therefore 5 3 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 1,2,3,4,5

Obviously, each give different remainder with 5 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 5^3 in the product.

1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 1,2,3,4,5,6,7,8\to 6 1 = 5 , 7 2 = 5 , 8 3 = 5 6-1=5,7-2=5,8-3=5

1 , 2 , 3 , 4 , 5 , 9 , 10 , 12 12 2 = 10 , 10 5 = 5 , 9 4 = 5 1,2,3,4,5,9,10,12\to 12-2=10,10-5=5,9-4=5

Raghav Vaidyanathan - 6 years, 3 months ago

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!!!

Willia Chang - 4 years, 12 months ago

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 ( 4 2 ) + ( 4 2 ) = 6 + 6 = 12 { 4 \choose 2 } + { 4 \choose 2 } = 6 + 6 = 12 . However, we need 2 16 2 ^ {16 } .

Calvin Lin Staff - 6 years, 3 months ago

Log in to reply

But actually, at least four of these numbers must be divisible by 4 4 . So we get 2 16 2^{16} . Looks like we have to consider powers of prime factors also. I omitted this in the solution.

Raghav Vaidyanathan - 6 years, 3 months ago

Log in to reply

Right. Please add that into your solution, and explain why / how.

Calvin Lin Staff - 6 years, 3 months ago

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.

Raghav Vaidyanathan - 6 years, 3 months ago

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!

Calvin Lin Staff - 6 years, 3 months ago

Since the problem did not state that the 8 integers were distinct, can we not have the product of the differences equal to zero?

A Former Brilliant Member - 6 years, 3 months ago

Log in to reply

Yes we can. 0 0 is divisible by every integer.

Raghav Vaidyanathan - 6 years, 3 months ago

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.

Philip Suskin - 1 year, 8 months ago

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 0 2 = 0 \frac{ 0}{2} = 0 .
"you can’t divide a number by 0" -> For example, 2 is not divisible by 0, since 2 0 \frac{2}{0} is undefined.

So, both Philip and Raghav's statements are true, but they are talking about different things.

Calvin Lin Staff - 1 year, 8 months ago

Nice solution. Made a mistake in the 2 2 's case.

Rahul Saha - 6 years, 3 months ago
Calvin Lin Staff
Mar 2, 2015

There are a few nice tricks involved in this problem.

If we let a i = i a _ i = i , then we get that P = 125411328000 P = 125411328000 , which gives us an upper bound on the answer. The challenge is to show that this is indeed the solution.

Observe that 125411328000 = 2 16 × 3 7 × 5 3 × 7 1 125411328000 = 2 ^ { 16 } \times 3^{ 7} \times 5^{3} \times 7 ^ 1 . We will work via the prime factors.

The cases of p = 3 , 5 , 7 p = 3, 5, 7 are much easier, and we will do them together. For each set of a i a_i , let b 1 b_1 be the number of a i a_i which leave a remainder of i i when divided by p p . Similarly, define b 2 , b p b_2, \ldots b_p .

Then, let s p = ( b 1 2 ) + ( b 2 2 ) + ( b p 2 ) s_p = { b_1 \choose 2 } + { b_2 \choose 2 } + \ldots { b_p \choose 2 } . We clearly have p s p P p ^ { s_p} \mid P .

How do we minimize s p s_p subject to b i = 8 \sum b_i = 8 ? Well, by Jensens's inequality, since ( b 2 ) = 1 2 × b × ( b 1 ) { b \choose 2 } = \frac{1}{2} \times b \times (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 s_p . Instead, we use a method called smoothing , to show that s p s_p is minimized when all of the b i b_i values differ by at least 1. In particular, we have

s 7 = ( 1 2 ) + ( 1 2 ) + ( 1 2 ) + ( 1 2 ) + ( 1 2 ) + ( 1 2 ) + ( 2 2 ) = 1 s_ 7 = { 1 \choose 2 } + { 1 \choose 2 } + { 1 \choose 2 } + { 1 \choose 2 } + { 1 \choose 2 } + { 1 \choose 2 } + { 2 \choose 2 } = 1 s 5 = ( 1 2 ) + ( 1 2 ) + ( 2 2 ) + ( 2 2 ) + ( 2 2 ) = 3 s_5 = { 1 \choose 2 } + { 1 \choose 2 } + { 2 \choose 2 } + { 2 \choose 2 } + { 2 \choose 2 } = 3 s 3 = ( 3 2 ) + ( 3 2 ) + ( 2 2 ) = 7 s_3 = { 3 \choose 2 } + {3 \choose 2 } + { 2 \choose 2 } = 7

Now, if we tried the same for p = 2 p = 2 , we will simply get s 2 = ( 4 2 ) + ( 4 2 ) = 12. s_2 = { 4 \choose 2 } + { 4 \choose 2 } = 12. However, we need 2 16 P 2 ^ {16} \mid P , instead of just 2 12 2 ^ {12} . How do we account for the additional powers of 2? Those arise when 4 a i a j 4 \mid 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 100 ! 100 ! , we take 100 2 + 100 4 + 100 8 + 100 16 + \lfloor \frac { 100 } { 2 } \rfloor + \lfloor \frac { 100 } { 4 } \rfloor + \lfloor \frac { 100 } { 8 } \rfloor + \lfloor\frac { 100 } { 16 } \rfloor + \ldots . This way, the contribution of 24 to the power of 2 comes in 3 places, namely 100 2 , 100 4 , 100 8 \lfloor \frac { 100 } { 2 } \rfloor, \lfloor \frac { 100 } { 4 } \rfloor, \lfloor \frac { 100 } { 8 } \rfloor .

So, let's count the number of " 2 2 2^2 terms" which will appear. By the above argument, we have

s 4 = ( 2 2 ) + ( 2 2 ) + ( 2 2 ) + ( 2 2 ) = 4. s_4 = { 2 \choose 2 } + { 2 \choose 2 } + { 2 \choose 2 } + { 2 \choose 2 } = 4 .

Hence, the number of powers of 2 will be s 2 + s 4 = 16 s_2 + s_4 = 16 . Thus, we can conclude that 2 16 P 2 ^ {16 } \mid P .


Now, can you generalize to the case of n 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 P value obtained by taking a i = i 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 ) E(p,k) (or whatever notation you prefer) to mean the number of pairs ( a i , a j ) (a_i,a_j) that are congruent m o d p k \mod p^k , ( p p prime, k k any whole number) and E ( p ) = E ( p , 1 ) + E ( p , 2 ) + . . . E(p)= E(p,1)+E(p,2)+... . In other words, P = 2 E ( 2 ) 3 E ( 3 ) 5 E ( 5 ) . . . P=2^{E(2)} 3^{E(3)} 5^{E(5)}...

Second comment is that the claim that the answer is the P P value obtained by taking a i = i a_i=i (namely, 1!2!3!4!5!6!7!) only requires that this selection minimizes each E ( p ) E(p) , but in fact it also minimizes each individual E ( p , k ) 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 ) E(p,k) is minimized when (to borrow your notation) all of the b i b_i values differ by at most 1.

Peter Byers - 6 years, 3 months ago

Log in to reply

Unfortunately, the claim in the second comment of

Given a polynomial with integer coefficients f ( x i ) f(x_i) , then the GCD of the values taken at integer points is equal to the minimum positive value of f ( x i ) f( x_i) (or even the minimum non-zero value of f ( x i ) | 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 f(x) = x^2 - 4 . Then, the minimum positive value is f ( 3 ) = 5 f(3) = 5 , the minimum positive absolute value is f ( 1 ) = 3 |f(1) | = 3 , and it is clear that the GCD of this sequence is just 1.

Calvin Lin Staff - 6 years, 3 months ago

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).

Peter Byers - 6 years, 3 months ago

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
Times @@ ((#[[1]] - #[[2]]) & /@ 
    Subsets[RandomInteger[1000, 8], {2}])/
 Product[i!, {i, 7}] // IntegerQ

So, the answer is actually

1
Product[i!, {i, 7}] 

It's just pigeonhole principle. For example, it is easy to show that 7 P 7 \mid P , and then it requires a bit of work to show that 5 3 P 5^3 \mid P .

Then, think why we must have 3 7 P 3 ^ 7 \mid 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 2 .


And once that is done, generalize. In particular, prove that the answer is of the form i ! \prod i ! .

Calvin Lin Staff - 6 years, 3 months ago

Log in to reply

One can prove the generalization using Vandermonde matrix.

Matheus Secco - 6 years, 3 months ago

Log in to reply

Could you add your solution? That would be a nice interpretation of ( x i x j ) \prod ( x_i - x_j) :)

Calvin Lin Staff - 6 years, 3 months ago
Aaghaz Mahajan
Apr 29, 2019

I'll just leave this here.......

Nicolas Bryenton
May 11, 2016

Note that a b 0 ( m o d n ) a b ( m o d n ) a-b\equiv 0\pmod{n} \implies a \equiv b \pmod{n} .

We can ignore negative integer factors of P P because we are looking for the largest number which always divides P P .

For n = k n=k , there are k k possible equivalencies ( m o d k ) \pmod{k} , namely 0 , 1 , . . . k 1 0, 1, ... k-1 . Since there are 8 integers a 0 i 7 a_{0\leq i \leq 7} , if k 8 k\geq8 , there are always enough possible equivalencies that each a 0 i 7 a_{0\leq i \leq 7} can be unique ( m o d k ) \pmod{k} . However, when k < 8 k<8 , there are not enough equivalencies so that each integer a 0 i 7 a_{0\leq i \leq 7} can be unique ( m o d k ) \pmod{k} . This involves the Pigeonhole Principle, which indicates that there are at least 8 k 8-k duplicates, i.e. at least 8 k 8-k pairs of integers such that a i a j ( m o d k ) k ( a i a j ) a_i \equiv a_j \pmod{k} \implies k \vert (a_i - a_j) . P P has 8 k 8-k factors of k k , so k 8 k k^{8-k} divides P P . This is true for all k < 8 k<8 .

Then, P P is always divisible​ by k = 1 7 k 8 k = k = 1 7 k ! = 125411328000 {\displaystyle \prod_{k=1}^{7} k^{8-k} } = {\displaystyle \prod_{k=1}^{7} k! } = 125411328000

This can be easily generalized for m m integers a 0 i m 1 a_{0\leq i \leq m-1} , using the same argument as above: P P is always divisible by k = 1 m 1 k m k = k = 1 m 1 k ! {\displaystyle \prod_{k=1}^{m-1} k^{m-k} } = {\displaystyle \prod_{k=1}^{m-1} k! }

Moderator note:

This solution makse a common error of modular arithemtic. If we have N 0 ( m o d a ) N \equiv 0 \pmod{a} and N 0 ( m o d b ) N \equiv 0 \pmod{b} , does it imply that N 0 ( m o d a b ) N \equiv 0 \pmod{ab} ?

Not necessarily, as in the case of a = b = N = 2 a= b = N = 2 , and we clearly do not have 2 0 ( m o d 4 ) 2 \equiv 0 \pmod{4} .

The conclusion that we can draw is N 0 ( m o d gcd ( a , b ) ) N \equiv 0 \pmod{ \gcd(a,b) } . Unfortunately, this isn't strong enough to complete the solution.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...