 # Problem of the Week Problem E and Solution Count on That

## Problem

Let $$n$$ be a positive integer. How many values of $$n$$ satisfy the following inequality? $(n-1)(n-3)(n-5)\cdots(n-2019)(n-2021) \leq 0$ Note: The product on the left side of the inequality consists of $$1011$$ factors of the form $$n-d$$, where the value of $$d$$ starts at $$1$$ and increases by $$2$$ for each subsequent factor. ## Solution

We will consider two cases. First when the product on the left side equals zero, and then when the product on the left side is less than zero.

Case 1: $$(n-1)(n-3)(n-5)\cdots(n-2019)(n-2021) = 0$$

The product of factors on the left side equals zero when any one of the factors is equal to zero. This happens when $$n=1,3,5,\ldots,2019,$$ or $$2021$$. These are all the odd integers between $$1$$ and $$2021$$, inclusive. The number of these integers is equal to $$\frac{2021+1}{2}=1011$$.

Case 2: $$(n-1)(n-3)(n-5)\cdots(n-2019)(n-2021) < 0$$

The product of factors on the left side is less than zero (i.e. negative) when none of the factors are equal to zero and an odd number of the factors are negative. Note that for every integer $$n$$, the following is true. $n-1>n-3>n-5>\cdots>n-2019>n-2021$ Now we notice the following.

• When $$n=2$$, it follows that $$n-1=1$$, $$n-3=-1$$, and so the remaining factors will all be negative. This is a total of $$1011-1=1010$$ negative factors. Since this is an even number, the product of factors will be positive.

• When $$n=4$$, it follows that $$n-1=3$$, $$n-3=1$$, $$n-5=-1$$, and so the remaining factors will all be negative. This is a total of $$1011-2=1009$$ negative factors. Since this is an odd number, the product of factors will be negative.

• When $$n=6$$, it follows that $$n-1=5$$, $$n-3=3$$, $$n-5=1$$, $$n-7=-1$$, and so the remaining factors will all be negative. This is a total of $$1011-3=1008$$ negative factors. Since this is an even number, the product of factors will be positive.

• When $$n=8$$, it follows that $$n-1=7$$, $$n-3=5$$, $$n-5=3$$, $$n-7=1$$, $$n-9=-1$$, and so the remaining factors will all be negative. This is a total of $$1011-4=1007$$ negative factors. Since this is an odd number, the product of factors will be negative.

This pattern continues, giving a negative product of factors when $$n=4,8,12,16,\ldots,2016,2020$$. Notice that these are all the multiples of $$4$$ that are less than $$2021$$. Since $$2020 \div 4 = 505$$, that tells us there are $$505$$ such values.

When $$n>2021$$, all the factors will be positive, and thus their product will also be positive.

Therefore, in total there are $$1011+505=1516$$ values of $$n$$ that satisfy the inequality.