Does a pie look like π \pi ?

Find the minimum value of n n such that any subset with n n of the elements in { 1 , 2 , 3 , . . . , 2018 } \{1, 2, 3, ... , 2018\} contains at least two elements that are not relatively prime.


Inspired by this problem


The answer is 308.

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

Atomsky Jahid
May 18, 2018

We can think about this problem in terms of Prime Power Factorization (PPF). So, the set { 1 , 2 , 3 , 4 , 5 , 6 , . . . , 2016 , 2017 , 2018 } \{1, 2, 3, 4, 5, 6, ... , 2016, 2017, 2018\} will look like { 1 , 2 , 3 , 2 2 , 5 , 2 × 3 , . . . , 2 5 × 3 2 × 7 , 2017 , 2 × 1009 } \{1, 2, 3, 2^2, 5, 2 \times 3, ... , 2^5 \times 3^2 \times 7, 2017, 2 \times 1009 \} . The first thing we need to do is to stack the elements into a subset that are coprime to each other. Our goal is to maximize the number of coprime elements that we can fit in that subset.

For two integers to be coprime they cannot both have a particular prime in their PPFs. That's why from all the numbers that have 2 2 in their PPFs (these numbers are even), we can only pick one. Similarly, if some numbers have a prime p p as a factor, they can contribute only one element to the subset that we're trying stack with coprimes.

As a result, picking up all the primes (or, their powers) will maximize the size of the subset. However, it's necessary to avoid composites that have more than one prime in their PPFs. For example, if we pick 6 = 2 × 3 6 = 2 \times 3 , we won't be able to pick other integers that have 2 or 3 or both in their PPFs. Certainly, the number of integers having 2 or 3 or both as a factor is greater than the number of integers that have either 2 or 3 as a factor. As a consequence, we'd be able to pick less integers for that relatively prime subset.

After adding all the primes between 1 1 and 2018 2018 , we can also add 1 1 to that subset since 1 1 is relatively prime to every other integer. At this point, the subset saturates. So, adding one more integer will end up giving us two integers that are not coprime. Therefore, the minimum value of n n that ensures our subset has at least two integers that are not coprime is equal to the number of primes in the given set plus 2.

Now, π ( k ) \pi(k) represents the number of primes that are less than or equal to k k .

So, the solution to this problem is π ( 2018 ) + 2 = 306 + 2 = 308 \pi(2018) + 2 = 306 + 2 = 308

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...