Coloring the integers

Let S S be a set of natural numbers. Let f ( S ) f(S) be equal to the minimum number k k such that it's possible to color every integer (all integers , 2 , 1 , 0 , 1 , 2 , \ldots, -2, -1, 0, 1, 2, \ldots , not only the set S S ) with one of k k colors, such that two integers whose difference is in S S have different colors. Let f ( S ) = 0 f(S) = 0 if no such minimum exists (if we need infinite colors). Compute f ( S ) f(S) for each of the following sets.

  1. S = { 1 , 2 , 4 , 8 , 16 , } S = \{1, 2, 4, 8, 16, \ldots\} is the set of powers of 2.
  2. S = { 2 , 4 , 6 , 8 , 10 , } S = \{2, 4, 6, 8, 10, \ldots\} is the set of positive even integers.
  3. S = { 2 , 3 , 5 , 7 , 11 , } S = \{2, 3, 5, 7, 11, \ldots\} is the set of prime numbers.
  4. S = { 2 , 3 , 4 , 5 } S = \{2, 3, 4, 5\}

Concatenate your answers. For example, if the answers are 7 , 2016 , 0 , 1 7, 2016, 0, 1 in that order, enter 7201601 7201601 .


The answer is 3044.

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.

1 solution

Ivan Koswara
Jan 13, 2016

The answers are 3 , 0 , 4 , 4 3, 0, 4, 4 .

To start, we will begin with two lemmas.

Lemma 1 : If A A is a set of integers such that any two of them have difference that is in S S , then we need at least A |A| colors.

This is straightforward: if we use less than A |A| colors, then by Pigeonhole Principle , two integers in A A will have the same color. By definition of A A , these two integers have difference that is in S S , contradicting the property in the problem (two integers whose difference is in S S may not have the same color).

Lemma 2 : If no element in S S is divisible by k k , then we need at most k k colors.

To prove this, we simply need to exhibit one coloring satisfying this property. This is obtained by simply coloring every integer by its remainder modulo k k . Two integers that have the same color must then have difference that is divisible by k k , and thus not in S S by assumption, so our coloring is valid.

With these two lemmas, we can now find the answers to the first three problems.

First problem : We use Lemma 1 with A = { 0 , 1 , 2 } A = \{0, 1, 2\} to show that we need at least three colors. We use Lemma 2 with k = 3 k = 3 to show that we need at most three colors. This completes the proof, showing that f ( S ) = 3 f(S) = 3 in this case.

Second problem : We use Lemma 1 with A A being the set of even integers. Yes, our A A is infinite, so we cannot complete it in any finite number of colors. Thus f ( S ) = 0 f(S) = 0 in this case.

Third problem : We use Lemma 1 with A = { 0 , 2 , 5 , 7 } A = \{0, 2, 5, 7\} to show that we need at least four colors. We use Lemma 2 with k = 4 k = 4 to show that we need at most four colors. This completes the proof, showing that f ( S ) = 4 f(S) = 4 in this case.

Fourth problem : This is the only problem that is different in nature.

First, we exhibit a simple coloring with four colors. Color them as , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , \ldots, 1, 1, 2, 2, 3, 3, 4, 4, 1, 1, 2, 2, 3, 3, 4, 4, \ldots . We can easily show that two integers of the same color will have a difference that is congruent to 0 , 1 , 7 ( m o d 8 ) 0, 1, 7 \pmod 8 , while elements of S S are congruent to 2 , 3 , 4 , 5 ( m o d 8 ) 2, 3, 4, 5 \pmod 8 , so no two integers of the same color will have a difference in S S .

Showing that we need four colors is more difficult. To do this, we will show that three colors is not enough.

Suppose it is enough. We first use Lemma 1 on A = { 0 , 2 , 4 } A = \{0, 2, 4\} to see that we need three colors, but more importantly, that 0 , 2 , 4 0, 2, 4 are all of different colors. Thus, by changing the names of the colors, we may assume that 0 , 2 , 4 0, 2, 4 gets the color red, green, blue in that order. Now, 6 must be red (because 6 2 , 6 4 S 6-2, 6-4 \in S , 2 is green, and 4 is blue), and 8 must be green (because 8 4 , 8 6 S 8-4, 8-6 \in S , 4 is blue, 6 is red). Then, 3 and 5 must both be blue (because 3 0 , 8 3 , 5 0 , 8 5 S 3-0, 8-3, 5-0, 8-5 \in S , 0 is red, 8 is green). But now 3 and 5 have the same color while their difference 2 is in S S , contradiction.

Thus three colors is not enough; we need four colors. So f ( S ) = 4 f(S) = 4 in this case. This completes the problem.


Bonus: Find f ( S ) f(S) for the following sets:

  1. S = { 1 , 2 , 6 , 24 , 120 , } S = \{1, 2, 6, 24, 120, \ldots\} is the set of factorial numbers.
  2. S = { 1 , 4 , 9 , 16 , 25 , } S = \{1, 4, 9, 16, 25, \ldots\} is the set of square numbers.

Moderator note:

Good approaches used here, which is very similar to that of Ramsey Theory.

How would you describe the ideas in Proof 4 using a lemma?

In part 1, what is the mistake in following coloring scheme (1A),(2B),(4A),(8B),(16A),.......and so no Where A and B represent the colors

Anmol Gupta - 5 years, 5 months ago

Log in to reply

You're not coloring the set S S ; you're coloring the whole integers such that no integers with difference in S S are colored the same.

Ivan Koswara - 5 years, 5 months ago

CM: The coloring with 4 colors is a modification of Lemma 2; something like "if there exists k , x k,x such that elements of S S modulo k x kx is not congruent to ( x 1 ) , ( x 2 ) , , x 1 -(x-1), -(x-2), \ldots, x-1 , then S S can be colored by k k colors ( x x consecutive numbers with one color, then x x consecutive numbers with the next color, and so on)". The proof of impossibility for 3 colors is just bifurcation.

Ivan Koswara - 5 years, 5 months ago

In the fourth set if I color 2 and 3 with say blue and 4 and 5 with green, then it does satisfy the condition that the numbers whose difference is also in the set has different colors.

Pranav Rao - 5 years, 4 months ago

Log in to reply

You need to color all integers ( , 2 , 1 , 0 , 1 , 2 , \ldots, -2, -1, 0, 1, 2, \ldots ), not only the set S S .

Ivan Koswara - 5 years, 4 months ago

Log in to reply

Ok thanks. Sorry I misunderstood the question itself.

Pranav Rao - 5 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...