Solution (source code)

= Solution

For each <interpolation node> define the <Lagrange cardinal polynomial>
$$
\ell_j(x)=\prod_{\substack{0\leq k\leq n\\k\ne j}}\frac{x-x_k}{x_j-x_k},\qquad 0\leq j\leq n.
$$
All denominators are nonzero because the <interpolation nodes> are distinct. Each <polynomial> has <polynomial degree> at most $n$, and $\ell_j(x_i)=\delta_{ij}$, where $\delta_{ij}$ is the <Kronecker delta>. Consequently the <linear combination>
$$
p_n(x)=\sum_{j=0}^n f_j\ell_j(x)
$$
belongs to the <vector space of univariate polynomials> $\Pi_n$ and has the required values. This proves existence of the <Lagrange interpolation polynomial>.

For uniqueness, suppose $p_n$ and $r_n$ both work. Their difference is a <polynomial> of <polynomial degree> at most $n$ with $n+1$ distinct <roots of a polynomial>. The <root bound for a polynomial> forces $p_n-r_n$ to be the <zero polynomial>.

The seven supplied values follow $f_i=i^2+1$. The <quadratic polynomial> $x^2+1$ belongs to $\Pi_6$ and takes all seven values, so uniqueness gives
$$
\boxed{p_6(x)=x^2+1.}
$$
The subscript bounds the <polynomial degree>; it does not require <polynomial degree> exactly six.