1. Let $S$ be the set of natural numbers $n$ such that each of the numbers $n+1, n+3, n+4, n+5, n+6$, and $n+8$ is composite. Determine the largest number $k$ with the property: For every $n \in S$ in the set

$$
\{n, n+1, n+2, n+3, n+4, n+5, n+6, n+7, n+8, n+9\}
$$

there are at least $k$ consecutive composite numbers
Solution. We will prove that $k=7$.

If $n=87$ then

$$
\{n+1, n+3, n+4, n+5, n+6, n+8\}=\{88,90,91,92,93,95\}
$$

are all composite numbers, so $S \neq \varnothing$. In the set

$$
\{n, n+1, n+2, \ldots, n+9\}=\{88,89,90, \ldots, 96\}
$$

the longest sequence of consecutive composite numbers has length 7. Therefore, $k \leq 7$.

i) Let $n \in S$ and $n+2$ be a prime number. Then it is odd, so $n+7$ and $n+9$ are even numbers greater than 2, which means they are composite numbers. Therefore, $n+3, n+4, n+5, n+6, n+7, n+8$ and $n+9$ are seven consecutive composite numbers.

ii) If $n \in S$ and $n+7$ is a prime number. Then $n+7$ is an odd number, so $n$ and $n+2$ are even numbers greater than 2, which means they are composite (since $2 \notin S$ because $n+1=3$ is a prime number). Thus, we have proved that $n, n+1, n+2, n+3, n+4, n+5$ and $n+6$ are seven consecutive composite numbers.

iii) If $n \in S$ and $n+2$ and $n+7$ are composite numbers, then the statement is obvious (in this case, there are at least 9 composite numbers).