For what $n$ is the following statement true:
There exists a choice of $ a_1, a_2, \ldots a_n \in \{ 0, 1 \}$, not all identical, such that there is a polynomial $F(x) \in \mathbb{R}[x]$ of degree at most $n-2$ such that $F(i ) = a_i$ for $i = 1 $ to $n$.
From my solution to this problem, the statement is false for prime $n$.
I was then considering the composite numbers case, but wasn't able to push through to get useful constraints. Clearly, for any values of $a_i$, we can find a unique polynomial of degree at most $n-1$ that satisfies it. The question boils down to whether the coefficient of $x^{n-1}$ can be 0.
I've tested specific cases:
If $n = 4$, then $1, 0, 0, 1$ gives us $\frac{x^2}{2} - \frac{5x}{2} + 3$.
If $n = 6$, then $1, 0, 0, 0, 0, 1$ gives us $\frac{ x^4}{24} - \frac{7x^3}{12} + \frac{71x^2}{24} - \frac{77x}{12} + 5$.
If $n = 9$, then $0, 0, 1, 1, 0, 0, 1, 0, 0$ gives us $\frac{x^7}{720} - \frac{2 x^6}{45} + \frac{203 x^5}{360} - \frac{65 x^4}{18} + \frac{8869 x^3}{720} - \frac{983 x^2}{45} + \frac{1117 x}{60} - 6$.
These are specific cases of the following:
- If $ n = 2k$, then $1, 0, 0, \ldots, 0, 1 $ works.
- If $n = 3k$ with $k$ odd, then $a_{k} = a_{k+1} = a_{2k+1} = 1 $ with the rest 0 works.
To see why they work without explicitly finding such a polynomial, we use the method of differences to show that the coefficient of $x^{n-1}$ is indeed 0 if it satisfies the equation
$${n-1 \choose 0 } a_1 - {n-1 \choose 1} a_2 + {n-1 \choose 2} a_3 + \ldots + (-1)^{n+1}{n-1 \choose 0} a_n = 0. $$
For $n = 2k$, we have ${n-1 \choose 0} = 1, {n-1 \choose n-1} = 1$, so we can set $ a_1 = a_n = 1$.
For $n = 3k$ with $k$ odd, we have ${ 3k-1 \choose k-1} = \frac{1}{2} {3k-1 \choose k} = {3k-1 \choose 2k}$, so we can set $a_{k} = a_{k+1} = a_{2k+1} = 1 $.
The polynomial can be recovered from the Method of Differences, or using Lagrange Interpolation.
My conjecture is that it's true for composite $n$, but I don't know how to proceed with the general case.
Note: For $n = 25$, $1,1,1,1,0,1,1,1,1,1,0,0,0,0,0,0,1,0,1,1,0,0,1,1,1$ works. I found it by playing with the binomial coefficients.
For $n = 35$, Sil found ${34 \choose 13 } - { 34 \choose 14} + {34 \choose 15} - {34 \choose 20} = 0$.
The cases of $ n = 49, 55$ are listed in Sil's solution.