Consider the function $f(x)=|x|$ on $[-1,1]$. Given $n\neq0$, define $x_n^k=-1+\frac{2k}{n}$ for $0\leq k \leq n$. Let $g_n(x)$ be the unique polynomial of degree n which results by interpolating the data with $g_n(x_n^k)=f(x_n^k)$ for all $0\leq k \leq n$. Plot the sequence ${g_n(0.3)_{1\leq n \leq 20}}$
I understand how to find each $g_n$ separately by using the formula, but I'm not sure how to write code for this.
