Solution (source code)

= Solution

For $k=2$ on an equidistant <spline knot sequence>, $N_i$ is the triangular hat with value one at $t_{i+1}$ and <support> $[t_i,t_{i+2}]$. Its slopes on the two pieces are $1/h$ and $-1/h$, and $M_i=N_i/h$. Direct integration gives
$$
\int N_i^2=2\int_0^h(u/h)^2\,du=\frac{2h}{3},\qquad
\int N_iN_{i+1}=\int_0^h(u/h)(1-u/h)\,du=\frac h6.
$$
Nonadjacent hats have disjoint interiors of their supports, so their <inner product> vanishes. Dividing by $h$ therefore gives
$$
\boxed{g_{ij}=\begin{cases}2/3,&i=j,\\1/6,&|i-j|=1,\\0,&|i-j|\ge2.\end{cases}}
$$
This <linear-spline mixed Gram matrix> is <tridiagonal>. Every diagonal entry is $2/3$, including the first and last: the distinct-knot hats have their full supports inside $[0,1]$. End rows simply lack one off-diagonal neighbor; there are no repeated endpoint <spline knots> here.