CEMC Banner

Problem of the Month
Solution to Problem 4: A Polynomial Sandwich

January 2025

  1. We present two solutions to Problem 1. In both solutions, we will use the so called triangle inequality. This frequently useful fact says that if \(u\) and \(v\) are real numbers, then \[|u+v|\leq |u|+|v|\] where \(|x|\) represents the absolute value of the real number \(x\). The triangle inequality can be applied twice to get that \(|u+v+w|\leq|u|+|v|+|w|\) for any real numbers \(u,v,\) and \(w\). If you are unfamiliar with the triangle inequality or even with absolute values, this might be a good time for an internet search!

    Solution 1:

    We will prove the following fact: If \(p(x)=Ax^3+Bx^2+Cx+D\) with real numbers \(A,B,C,\) and \(D\) and \(A\neq 0\), then there are infinitely many integers \(n\) such that \(p(n)>0\) and infinitely many integers \(m\) such that \(p(m)<0\).

    Then \(a=\dfrac{1}{3}\) can be deduced from this fact. To see this, consider the polynomial \[\begin{align*} q(x)&= f(x)-\left(\dfrac{1}{3}x^3+x^2+2x+\dfrac{4}{3}\right) \\ &= \left(a-\dfrac{1}{3}\right)x^3+(b-1)x^2+(c-2)x+\left(d-\dfrac{4}{3}\right).\end{align*}\] Using the given information, \(q(n)\leq 0\) for every integer \(n\) with the possible exception of \(n=-2\). This means \(q(n)>0\) for at most one integer. By the fact above, if \(a-\dfrac{1}{3}\) were different from \(0\), then there would be infinitely many integers \(n\) with \(q(n)>0\). This means we must have \(a-\dfrac{1}{3}=0\).

    Interestingly, we have only used one of the two inequalities given in the problem. To understand why we can only use one of the inequalities, you may want to reread the hint for this problem and think about what the inequalities say when \(n\) is negative versus when \(n\) is positive.

    To prove the fact above, set \(M=\max\{|B|,|C|,|D|\}\). In particular, this means \(M\) is at least as large as each of \(|B|,|C|,\) and \(|D|\).

    If \(B=C=D=0\), then \(p(n)>0\) when \(n>0\) and \(p(m)<0\) when \(m<0\) or vice versa, depending on the sign of \(A\). For the rest of the proof, we assume not all of \(B,C,\) and \(D\) are zero, which means \(M>0\).

    For any nonzero integer \(n\), using the triangle inequality and the fact that \(1\leq|n|\leq |n|^2\leq |n|^3\) we get that \[\begin{align*} |Bn^2+Cn+D| &\leq |Bn^2|+|Cn|+|D| \\ &= |B||n|^2+|C||n|+|D| \\ &\leq |B||n|^2 + |C||n|^2 + |D||n|^2 \\ &\leq M|n|^2+M|n|^2+M|n|^2 \\ &= 3M|n|^2.\end{align*}\] If \(u\) and \(v\) are real numbers with \(v\) positive, the inequality \(|u|\leq v\) is really saying that \(-v\leq u\leq v\). Since \(3M|n|^2\) is positive, the chain of inequalities above implies that \[-3M|n|^2\leq Bn^2+Cn+D\leq 3M|n|^2.\] Adding \(An^3\) to this chain of inequalities gives \[\begin{align*} An^3-3M|n|^2 &\leq p(n)\leq An^3+3M|n|^2\tag{$*$}\end{align*}\] for all nonzero integers \(n\).

    We will use these inequalities to show that as long as \(A\neq 0\), there are infinitely many integers \(n\) with \(p(n)>0\) and infinitely many integers \(m\) with \(p(m)<0\).

    First, suppose \(A>0\). In this case, choose any positive integer \(n>\dfrac{3M}{A}\). There are infinitely many such \(n\) since \(M\) and \(A\) are constants. Noting that \(0<n^2=|n|^2\), this implies \(n^3>\dfrac{3M}{A}|n|^2\). Since \(A>0\), we can multiply both sides by \(A\) and rearrange to get \(0<An^3-3M|n|^2\). Combining with \((*)\), this implies \(p(n)>0\) for any positive integer \(n>\dfrac{3M}{A}\).

    Now choose any negative integer \(m<\dfrac{-3M}{A}\). As in the previous paragraph, \(0<m^2=|m|^2\), which implies \(m^3<-\dfrac{3M}{A}|m|^2\), which can be rearranged to \(Am^3+3M|m|^2<0\). Combining with \((*)\), gives \(p(m)<0\) for any negative integer \(m<\dfrac{-3M}{A}\), and there are infinitely many such \(m\).

    In a similar manner we can deal with the case of \(A < 0\), proving the fact is true for all \(A \neq 0\).

    Solution 2:

    We will assume that \(a\neq\dfrac{1}{3}\) and deduce a contradiction. First, assume \(a>\dfrac{1}{3}\). By rearranging the inequality \[an^3+bn^2+cn+d\leq \dfrac{1}{3}n^3+n^2+2n+\dfrac{4}{3},\] which holds for all integers except possibly \(n=-2\), we get \[\left(a-\dfrac{1}{3}\right)n^3\leq (1-b)n^2+(2-c)n+\dfrac{4}{3}-d.\] Multiplying through by \(3\) gives \[(3a-1)n^3\leq 3(1-b)n^2+3(2-c)n+4-3d.\] Dividing through by \(n^3\) gives \[3a-1\leq \dfrac{3(1-b)}{n}+\dfrac{3(2-c)}{n^2}+\dfrac{(4-3d)}{n^3},\] but we are only guaranteed that this inequality holds for positive integers \(n\) since the original inequality may fail at \(n=-2\), and dividing by a negative integer \(n\) would have reversed the inequality.

    For any real number \(u\), we have \(u\leq |u|\), which means \[3a-1\leq \left|\dfrac{3(1-b)}{n}\right|+\left|\dfrac{3(2-c)}{n^2}\right|+\left|\dfrac{(4-3d)}{n^3}\right|.\] Noting that \(\dfrac{1}{n^2}<\dfrac{1}{n}\) and \(\dfrac{1}{n^3}<\dfrac{1}{n}\) for all integers \(n>1\), we get \[\begin{align*} 3a-1&\leq \left|\dfrac{3(1-b)}{n}\right|+\left|\dfrac{3(2-c)}{n^2}\right|+\left|\dfrac{(4-3d)}{n^3}\right| \\ &= \left|3(1-b)\right|\dfrac{1}{n}+\left|3(2-c)\right|\dfrac{1}{n^2}+\left|(4-3d)\right|\dfrac{1}{n^3} \\ &< \left|3(1-b)\right|\dfrac{1}{n}+\left|3(2-c)\right|\dfrac{1}{n}+\left|(4-3d)\right|\dfrac{1}{n} \\ &= \dfrac{1}{n}\left(\left|3(1-b)\right|+\left|3(2-c)\right|+\left|(4-3d)\right|\right)\end{align*}\] and so \[\begin{align*} 3a-1 &< \dfrac{1}{n}\left(\left|3(1-b)\right|+\left|3(2-c)\right|+\left|(4-3d)\right|\right) \tag{$**$}\end{align*}\] for every integer \(n>1\). Recall that \(a>\dfrac{1}{3}\) which implies \(3a-1>0\). If \(\left|3(1-b)\right|+\left|3(2-c)\right|+\left|(4-3d)\right|\) is equal to 0, then \((**)\) says that something positive is less than 0, which can never happen. Otherwise, the quantity \(\left|3(1-b)\right|+\left|3(2-c)\right|+\left|(4-3d)\right|\) is some positive number, which means that by taking \(n\) large enough, we can force \[\dfrac{1}{n}\left(\left|3(1-b)\right|+\left|3(2-c)\right|+\left|(4-3d)\right|\right)<3a-1\] which violates \((**)\) as well. In other words, \((**)\) can only hold for finitely many positive integers \(n\). However, the assumption \(a>\dfrac{1}{3}\) implies that \((**)\) holds for all positive integers. This means it must not be the case that \(a>\dfrac{1}{3}\) so we conclude that \(a\leq\dfrac{1}{3}\).

    Similarly, if we assume \(a<\dfrac{1}{3}\), we can use the other inequality to derive a contradiction. When doing this, one would need to be careful to take \(n<-2\) since the assumed inequality is not guaranteed to hold for \(n=-2\).

    If you have learned a bit about limits in a calculus course, you might want to think about how this relates to the Squeeze Theorem. In fact, the Squeeze Theorem can be used to give a very short proof that \(a=\dfrac{1}{3}\).

  2. Since \[\dfrac{1}{3}n^3-n-\dfrac{2}{3}\leq f(n)\leq \dfrac{1}{3}n^3+n^2+2n+\dfrac{4}{3},\] for all integers (except possibly \(n=-2\)), this chain of inequalities provides an interval in which \(f(n)\) lies for each integer \(n\neq -2\). Since \(f(n)\) is an integer, this will give a finite number of possible values of \(f(n)\). By finding integers \(n\) for which there are a small number of possibilities for \(f(n)\), we will be able to find a finite list of possibilities for \(f(x)\). To help with this, consider the polynomial \[h(x)=\left(\dfrac{1}{3}x^3+x^2+2x+\dfrac{4}{3}\right)-\left(\dfrac{1}{3}x^3-x-\dfrac{2}{3}\right)=x^2+3x+2.\] For an integer \(n\), \(h(n)\) is the length of the interval containing \(f(n)\). Integers \(n\) where \(h(n)\) is small will have a small number of possibilities for the value of \(f(n)\).

    Notice that \(h(x)=(x+1)(x+2)\), so we expect \(h(n)\) to be smallest when \(n\) is either equal to or near \(-1\) and \(-2\). We are not guaranteed that the inequalities hold for \(n=-2\). Therefore, we will substitute \(n=-1\), \(n=0\), and \(n=-3\).

    When \(n=-1\), \[\begin{align*} \dfrac{1}{3}(-1)^3-(-1)-\dfrac{2}{3} &\leq f(-1) \leq \dfrac{1}{3}(-1)^3+(-1)^2+2(-1)+\dfrac{4}{3} \\ \\ 0 &\leq f(-1) \leq 0 \end{align*}\] which means \(f(-1)=0\).

    When \(n=0\), we have \[\begin{align*} \dfrac{1}{3}(0)^3-(0)-\dfrac{2}{3} & \leq f(0) \leq \dfrac{1}{3}(0)^3+(0)^2+2(0)+\dfrac{4}{3} \\ \\ -\dfrac{2}{3} & \leq f(0) \leq \dfrac{4}{3}\end{align*}\] and since \(f(0)\) is an integer, this means \(f(0)=0\) or \(f(0)=1\).

    Finally, with \(n=-3\), we get \[\begin{align*} \dfrac{1}{3}(-3)^3-(-3)-\dfrac{2}{3} &\leq f(-3) \leq \dfrac{1}{3}(-3)^3+(-3)^2+2(-3)+\dfrac{4}{3} \\ \\ -\dfrac{20}{3} &\leq f(-3) \leq -\dfrac{14}{3}\end{align*}\] and since \(f(-3)\) must be an integer, we get that \(f(-3)\) is either \(-6\) or \(-5\).

    We can translate this into information about the unknown coefficients, \(b\), \(c\), and \(d\) of \(f(n)\). From \(f(-1)=0\), we get \[0=\dfrac{1}{3}(-1)^3+b(-1)^2+c(-1)+d=-\dfrac{1}{3}+b-c+d\] or \(b-c+d=\dfrac{1}{3}\).

    Substituting \(n=0\), we have that \(f(0)=d\), which implies \(d=0\) or \(d=1\).

    Since \(f(-3)=-5\) or \(f(-3)=-6\) and \[f(-3)=\dfrac{1}{3}(-3)^3+b(-3)^2+c(-3)+d=-9+9b-3c+d.\] it must be that \(9b-3c+d=4\) or \(9b-3c+d=3\). This means \(b\), \(c\), and \(d\) satisfy one of the following four systems of equations:

    \[\begin{align*} b - c + d &= \dfrac{1}{3} \\ 9b - 3c + d &= 3 \\ d&=0\end{align*}\]

    \[\begin{align*} b - c + d & = \dfrac{1}{3} \\ 9b - 3c + d & = 3 \\ d&=1\end{align*}\]

    \[\begin{align*} b - c + d & = \dfrac{1}{3} \\ 9b - 3c + d & = 4 \\ d&=0\end{align*}\]

    \[\begin{align*} b - c + d & = \dfrac{1}{3} \\ 9b - 3c + d & = 4 \\ d&=1\end{align*}\]

    Consider the first system. If \(d=0\) is substituted into the first two equations, they simplify to \(b-c=\dfrac{1}{3}\) and \(9b-3c = 3\). Multiplying the first of these resulting equations by \(3\) gives \(3b-3c=1\), which can be subtracted from \(9b-3c=3\) to get \(6b=2\) or \(b=\dfrac{1}{3}\). Since \(b-c=\dfrac{1}{3}\), this means \(c=0\). Therefore, one possibility for the polynomial \(f(x)\) is \(f(x)=\dfrac{1}{3}x^3+\dfrac{1}{3}x^2\).

    The other three systems can be solved in a similar way. This gives a total of four possibilities for \(f(x)\) which are listed below in factored form: \[\begin{align*} \dfrac{1}{3}x^3+\dfrac{1}{3}x^2 &= \dfrac{1}{3}x^2(x+1) \\ \\ \dfrac{1}{3}x^3+\dfrac{2}{3}x^2+\dfrac{4}{3}x+1 &= \dfrac{1}{3}(x+1)(x^2+x+3) \\ \\ \dfrac{1}{3}x^3+\dfrac{1}{2}x^2+\dfrac{1}{6}x &= \dfrac{1}{6}x(x+1)(2x+1) \\ \\ \dfrac{1}{3}x^3+\dfrac{5}{6}x^2+\dfrac{3}{2}x+1 &= \dfrac{1}{6}(x+1)(2x^2+3x+6)\end{align*}\]

    When \(n=1\) is substituted into the first, second, and fourth polynomials, the outputs are \(\dfrac{2}{3}\), \(\dfrac{10}{3}\), and \(\dfrac{11}{3}\), respectively. None of these are integers, which means \(f(x)\) cannot be any of these three polynomials since \(f(n)\) must be an integer when \(n\) is an integer. Therefore, the only possibility is that \[f(x)=\dfrac{1}{3}x^3+\dfrac{1}{2}x^2+\dfrac{1}{6}x=\dfrac{x(x+1)(2x+1)}{6}.\]

    We now verify that \(f(x)\) has the properties claimed in the question.

    To see that \(f(n)\) is an integer for every integer \(n\), we will show that \(n(n+1)(2n+1)\), the numerator of \(f(n)\), must be a multiple of \(6\). Since \(n\) and \(n+1\) are consecutive integers, one of them must be even. This means \(n(n+1)(2n+1)\) is even. If either \(n\) or \(n+1\) is a multiple of \(3\), then \(n(n+1)(2n+1)\) is a multiple of \(3\). If neither \(n\) nor \(n+1\) is a multiple of \(3\), then \(n\) must be 1 more than a multiple of \(3\). That is, there is some integer \(k\) so that \(n=3k+1\). Then \(2n+1=2(3k+1)+1=6k+3=3(2k+1)\), so \(2n+1\) is a multiple of \(3\). This shows that \(n(n+1)(2n+1)\) must be a multiple of \(3\). Therefore, \[f(n)=\dfrac{n(n+1)(2n+1)}{6}\] is an integer for every integer \(n\). You may recognize that \(f(n)=1^2+2^2+3^2+\cdots+n^2\), which immediately implies \(f(n)\) is an integer.

    Next, we will show that \(\dfrac{1}{3}n^3-n-\dfrac{2}{3}\leq f(n)\) or \[\dfrac{1}{3}n^3-n-\dfrac{2}{3}\leq\dfrac{1}{3}n^3+\dfrac{1}{2}n^2+\dfrac{1}{6}n\] for all integers \(n\) with the possible exception of \(n=-2\). After rearranging, this inequality is equivalent to \[0\leq \dfrac{1}{2}n^2+\dfrac{7}{6}n+\dfrac{2}{3}.\] Since \(6\) is positive, the inequality is also equivalent to \[0\leq 6\left(\dfrac{1}{2}n^2+\dfrac{7}{6}n+\dfrac{2}{3}\right)=3n^2+7n+4=(3n+4)(n+1).\] The polynomial \((3x+4)(x+1)\) is quadratic and has roots \(x=-1\) and \(x=-\dfrac{4}{3}\). The leading coefficient is positive, which means it can only take negative values strictly between \(-\dfrac{4}{3}\) and \(-1\). There are no integers in this range, which means \((3n+4)(n+1)\geq 0\) for all integers \(n\). Thus, the original inequality also holds for all integers \(n\) including \(n=-2\).

    Now consider the polynomial \((x+1)(3x+8)\) which has roots \(x=-\dfrac{8}{3}\) and \(x=-1\). The only integer \(n\) for which \((n+1)(3n+8)\) is negative is \(n=-2\) since \(-2\) is the only integer between \(-\dfrac{8}{3}\) and \(-1\). Therefore, for all integers \(n\neq -2\), we have \[0\leq (n+1)(3n+8)\] which we expand and divide by \(6\) to get \[0\leq\dfrac{1}{2}n^2+\dfrac{11}{6}n+\dfrac{4}{3}.\] After rearranging and adding \(\dfrac{1}{3}n^3\) to both sides, we have that \[f(n)=\dfrac{1}{3}n^3+\dfrac{1}{2}n^2+\dfrac{1}{6}n\leq\dfrac{1}{3}n^3+n^2+2n+\dfrac{4}{3}\] for all integers \(n\neq-2\). Combining this with the other inequality, we have now shown that \[\dfrac{1}{3}n^3-n-\dfrac{2}{3}\leq f(n)\leq \dfrac{1}{3}n^3+n^2+2n+\dfrac{4}{3}\] for all integers \(n\neq -2\).

    Finally, let’s compute \(f(10^{2025})-f(10^{2025}-1)\). To do this, we will work out \(f(n)-f(n-1)\) for general \(n\) and substitute \(n=10^{2025}\) into the resulting expression. \[\begin{align*} f(n)-f(n-1) &= \dfrac{n(n+1)(2n+1)}{6}-\dfrac{(n-1)[(n-1)+1][2(n-1)+1]}{6} \\ &= \dfrac{n[(n+1)(2n+1)-(n-1)(2n-1)]}{6} \\ &= \dfrac{n(2n^2+n+2n+1-2n^2+n+2n-1)}{6} \\ &= \dfrac{n(6n)}{6} \\ &= n^2\end{align*}\] Therefore, \(f(10^{2025})-f(10^{2025}-1)=(10^{2025})^2=10^{4050}\). As mentioned earlier, the polynomial \(f(x)\) has the special property that \(f(n)=1^2+2^2+3^2+\cdots+n^2\) for every \(n\geq 1\). It follows from this property that \(f(n)-f(n-1)=n^2\).

Notice that we used the fact that \(n \neq -2\) to prove the inequality \(f(n) \leq \frac{1}{3} n^3 + n^2 + 2n + \frac{4}{3}\). It is worth thinking about what happens at \(n = -2\), and seeing if you can figure out why we had to exclude \(n = -2\).