Subfield: Algebra


Question: Suppose there are $n$ plates equally spaced around a circular table. Ross wishes to place an identical gift on each of $k$ plates, so that no two neighbouring plates have gifts. Let $f(n, k)$ represent the number of ways in which he can place the gifts. For example $f(6,3)=2$, as shown below.
![](https://cdn.mathpix.com/cropped/2023_12_21_1bbe653ae31ae7a70c3cg-1.jpg?height=344&width=674&top_left_y=454&top_left_x=754)

Throughout this problem, we represent the states of the $n$ plates as a string of 0's and 1's (called a binary string) of length $n$ of the form $p_{1} p_{2} \cdots p_{n}$, with the $r$ th digit from the left (namely $p_{r}$ ) equal to 1 if plate $r$ contains a gift and equal to 0 if plate $r$ does not. We call a binary string of length $n$ allowable if it satisfies the requirements - that is, if no two adjacent digits both equal 1. Note that digit $p_{n}$ is also "adjacent" to digit $p_{1}$, so we cannot have $p_{1}=p_{n}=1$.
Determine the smallest possible value of $n+k$ among all possible ordered pairs of integers $(n, k)$ for which $f(n, k)$ is a positive multiple of 2009 , where $n \geq 3$ and $k \geq 2$.

Solution:
We develop an explicit formula for $f(n, k)$ by building these strings.

Consider the allowable strings of length $n$ that include $k$ 1's. Either $p_{n}=0$ or $p_{n}=1$.

Consider first the case when $p_{n}=0$. (Here, $p_{1}$ can equal 0 or 1.)

These strings are all of the form $p_{1} p_{2} p_{3} \cdots p_{n-1} 0$.

In this case, since a 1 is always followed by a 0 and the strings end with 0 , we can build these strings using blocks of the form 10 and 0 . Any combination of these blocks will be an allowable string, as each 1 will always be both preceded and followed by a 0 .

Thus, these strings can all be built using $k 10$ blocks and $n-2 k 0$ blocks. This gives $k$ 1 's and $k+(n-2 k)=n-k 0$ 's. Note that any string built with these blocks will be allowable and will end with a 0 , and any such allowable string can be built in this way.

The number of ways of arranging $k$ blocks of one kind and $n-2 k$ blocks of another kind is $\left(\begin{array}{c}k+(n-2 k) \\ k\end{array}\right)$, which simplifies to $\left(\begin{array}{c}n-k \\ k\end{array}\right)$.

Consider next the case when $p_{n}=1$.

Here, we must have $p_{n-1}=p_{1}=0$, since these are the two digits adjacent to $p_{n}$.

Thus, these strings are all of the form $0 p_{2} p_{3} \cdots 01$.

Consider the strings formed by removing the first and last digits.

These strings are allowable, are of length $n-2$, include $k-11$ 's, end with 0 , and can begin with 0 or 1 .

Again, since a 1 is always followed by a 0 and the strings end with 0 , we can build these strings using blocks of the form 10 and 0 . Any combination of these blocks will be an allowable string, as each 1 will always be both preceded and followed by a 0 .

Translating our method of counting from the first case, there are $\left(\begin{array}{c}(n-2)-(k-1) \\ k-1\end{array}\right)$ or



$\left(\begin{array}{c}n-k-1 \\ k-1\end{array}\right)$ such strings.

Thus, $f(n, k)=\left(\begin{array}{c}n-k \\ k\end{array}\right)+\left(\begin{array}{c}n-k-1 \\ k-1\end{array}\right)$ such strings.

In order to look at divisibility, we need to first simplify the formula:

$$
\begin{aligned}
f(n, k) & =\left(\begin{array}{c}
n-k \\
k
\end{array}\right)+\left(\begin{array}{c}
n-k-1 \\
k-1
\end{array}\right) \\
& =\frac{(n-k) !}{k !(n-k-k) !}+\frac{(n-k-1) !}{(k-1) !((n-k-1)-(k-1)) !} \\
& =\frac{(n-k) !}{k !(n-2 k) !}+\frac{(n-k-1) !}{(k-1) !(n-2 k) !} \\
& =\frac{(n-k-1) !(n-k)}{k !(n-2 k) !}+\frac{(n-k-1) ! k}{k !(n-2 k) !} \\
& =\frac{(n-k-1) !(n-k+k)}{k !(n-2 k) !} \\
& =\frac{n(n-k-1) !}{k !(n-2 k) !} \\
& =\frac{n(n-k-1)(n-k-2) \cdots(n-2 k+2)(n-2 k+1)}{k !}
\end{aligned}
$$

Now that we have written $f(n, k)$ as a product, it is significantly easier to look at divisibility.

Note that $2009=41 \times 49=7^{2} \times 41$, so we need $f(n, k)$ to be divisible by 41 and by 7 twice. For this to be the case, the numerator of $f(n, k)$ must have at least one more factor of 41 and at least two more factors of 7 than the denominator.

Also, we want to minimize $n+k$, so we work to keep $n$ and $k$ as small as possible.

If $n=49$ and $k=5$, then

$$
f(49,5)=\frac{49(43)(42)(41)(40)}{5 !}=\frac{49(43)(42)(41)(40)}{5(4)(3)(2)(1)}=49(43)(14)
$$

which is divisible by 2009 .

We show that this pair minimizes the value of $n+k$ with a value of 54 .

We consider the possible cases by looking separately at the factors of 41 and 7 that must occur. We focus on the factor of 41 first.

For the numerator to contain a factor of 41 , either $n$ is divisible by 41 or one of the terms in the product $(n-k-1)(n-k-2) \cdots(n-2 k+1)$ is divisible by 41 .

Case 1: $n$ is divisible by 41

We already know that $n=82$ is too large, so we consider $n=41$. From the original interpretation of $f(n, k)$, we see that $k \leq 20$, as there can be no more than 20 gifts placed on 41 plates.

Here, the numerator becomes 41 times the product of $k-1$ consecutive integers, the largest of which is $40-k$.

Now the numerator must also contain at least two factors of 7 more than the denominator. But the denominator is the product of $k$ consecutive integers. Since the numerator contains the product of $k-1$ consecutive integers and the denominator contains the product of $k$ consecutive integers, then the denominator will always include at least as many multiples of 7 as the numerator (since there are more consecutive integers in the product in the denominator). Thus, it is impossible for the numerator to contain even one more



additional factor of 7 than the denominator.

Therefore, if $n=41$, then $f(n, k)$ cannot be divisible by 2009 .

Case 2: $n$ is not divisible by 41

This means that the factor of 41 in the numerator must occur in the product

$$
(n-k-1)(n-k-2) \cdots(n-2 k+1)
$$

In this case, the integer 41 must occur in this product, since an occurrence of 82 would make $n$ greater than 82 , which does not minimize $n+k$.

So we try to find values of $n$ and $k$ that include the integer 41 in this list.

Note that $n-k-1$ is the largest factor in the product and $n-2 k+1$ is the smallest.

Since 41 is contained somewhere in the product, then $n-2 k+1 \leq 41$ (giving $n \leq 40+2 k$ ) and $41 \leq n-k-1$ (giving $n \geq 42+k$ ).

Combining these restrictions, we get $42+k \leq n \leq 40+2 k$.

Now, we focus on the factors of 7 .

Either $n$ is not divisible by 7 or $n$ is divisible by 7 .

* If $n$ is not divisible by 7 , then at least two factors of 7 must be included in the product

$$
(n-k-1)(n-k-2) \cdots(n-2 k+1)
$$

which means that either $k \geq 8$ (to give two multiples of 7 in this list of $k-1$ consecutive integers) or one of the factors is divisible by 49 .

- If $k \geq 8$, then $n \geq 42+k \geq 50$ so $n+k \geq 58$, which is not minimal.
- If one of the factors is a multiple of 49 , then 49 must be included in the list so $n-2 k+1 \leq 49$ (giving $n \leq 48+2 k$ ) and $49 \leq n-k-1$ (giving $n \geq 50+k$ ). In this case, we already know that $42+k \leq n \leq 40+2 k$ and now we also have $50+k \leq n \leq 48+2 k$.

For these ranges to overlap, we need $50+k \leq 40+2 k$ and so $k \geq 10$, which means that $n \geq 50+k \geq 60$, and so $n+k \geq 70$, which is not minimal.

* Next, we consider the case where $n$ is a multiple of 7 .

Here, $42+k \leq n \leq 40+2 k$ (to include 41 in the product) and $n$ is a multiple of 7 .

Since $k$ is at least 2 by definition, then $n \geq 42+k \geq 44$, so $n$ is at least 49 .

If $n$ was 56 or more, we do not get a minimal value for $n+k$.

Thus, we need to have $n=49$. In this case, we do not need to look for another factor of 7 in the list.

To complete this case, we need to find the smallest value of $k$ for which 49 is in the range from $42+k$ to $40+2 k$ because we need to have $42+k \leq n \leq 40+2 k$.

This value of $k$ is $k=5$, which gives $n+k=49+5=54$.

Since $f(49,5)$ is divisible by 2009 , as determined above, then this is the case that minimizes $n+k$, giving a value of 54 .

Final answer: 54