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.
The conjecture that this is possible for all composite $n$ is false, the smallest composite $n$ that fails this condition is $n=65$.
This is done by computer search. I've used the equivalent form by checking sums of binomial numbers. In a spirit of @DavidESpeyer's comment, I've evaluated all possible sums given by proper subsets of $\{\binom{n-1}{0},\binom{n-1}{2},\binom{n-1}{4}, \dots, \binom{n-1}{n-1} \}$ and $\{ \binom{n-1}{1},\binom{n-1}{3},\binom{n-1}{5}, \dots, \binom{n-1}{n-2} \}$ and then checked if the two sums sets intersect. Following is a quick & dirty implementation in Python, I am sure it could be optimized (it uses a lots of memory!).
The output given is an empty set, so there is no choice possible.
Still there could be a mistake, independent verification is welcome.
To show this is indeed the smallest counterexample, consider following solutions for $n=49$ and $n=55$:
$$ \sum_{x \in \{1, 3, 5, 7, 11, 13, 15, 17, 19, 35, 43, 47\}} \binom{48}{x}=\sum_{y \in \{0, 2, 6, 8, 12, 14, 20, 46, 48\}} \binom{48}{y} $$
and
$$ \sum_{x \in \{15, 17, 21, 33, 39\}} \binom{54}{x}=\sum_{y \in \{14, 20, 22\}} \binom{54}{y}. $$
Next unresolved cases, i.e. composites coprime to $6$, are $$ 77, 85, 91, 95, 115, 119, 121, 125, 133, 143, 145, 155, 161, 169, 175, 185, 187,\dots $$
Perhaps the optimized version of the above approach can find more counterexamples, then maybe some pattern emerges (or not and these might be more of a "random" occurrences).