TITLE: Question about polynomials with coefficients in Z
QUESTION [16 upvotes]: Let $f = a_0 + a_1 x + \ldots + a_n x^n$ ($f \ne 0$), where $a_i \in \{-1, 0, 1\}$. Let $p(f)$ be the largest number such that $f(x)$ is divisible by $y$ for any integer $x$ and for any $1 \leq y \leq p(f)$. Let $g(n)=max_f\; p(f)$. Is it true that $g(n) = o(n)$? What is the best upper or lower bound on $g(n)$ can be derived?
For my application it would be great to prove that $g(n) = o(n)$ in order to obtain something non-trivial, or $g(n) = o(n^{2/5})$ in order to improve the best known result. Do you think it is real?
UPD It is an obvious consequence of Bertrand's postulate and Schwartz–Zippel lemma that $g(n) \leq 2n$. Using bruteforce I've got the following values:
$g(10) = 7$, $f = x^{10} + x^8 - x^4 - x^2$.
$g(15) = 10$, $f = x^{15} + x^{13} + x^{12} + x^{11} + x^{10} - x^7 - x^6 - x^5 - x^4 - x^3$.
$g(17) = 10$, $f = x^{16} + x^{15} + x^{14} + x^{13} + x^{12} + x^{11} - x^8 - x^7 - x^6 - x^5 - x^4 - x^3$.

REPLY [11 votes]: The point of this answer is to point out that Kevin Costello's heuristic can be made rigorous. For any positive $\epsilon$, if $y=O(n^{1/2-\epsilon})$ then such a polynomial exists for large $n$.
Lemma: Let $G$ be a finite abelian group and let $g_1$, $g_2$, ..., $g_n$ be elements of $G$. If $2^n > |G|$ then there are integers $\epsilon_i \in \{ -1, 0, 1 \}$, not all zero, such that $\sum \epsilon_i g_i =0$.
Proof: Consider the $2^n$ sums $\sum a_i g_i$ with $a_i \in \{ 0, 1 \}$. By the pigeonhole principle, two of these are equal. Subtracting them, we get the claimed relation. QED
Now, consider the abelian group
$$G:=\bigoplus_{k=1}^y (\mathbb{Z}/k)^{\oplus k}.$$
Let $g_i$ be the element of $G$ whose $k$-th component is $(0^i, 1^i, 2^i, 3^i, \ldots, (k-1)^i)$, for $i=0$, $1$, ..., $n$. The order of $G$ is $\exp( \sum k \log k) = \exp( O(y^2 \log y))$. So, if $y=O(n^{1/2-\epsilon})$, then $2^{n+1} > |G|$ and the lemma tells us that there are $\epsilon_i$ such that $\sum \epsilon_i g_i=0$. Then $\sum \epsilon_i x^i$ is the required polynomial.
There is a lot of slack in this argument, but Bjorn's argument shows that we can't improve the exponent of $n$ by tightening it.