Solution (source code)

= Solution

Let $C_k(u)$ be the order-$k$ <Cardinal B-spline> supported on $[0,k]$. The <Cox-de Boor recurrence> on unit-spaced knots reads
$$
C_k(u)=\frac{u}{k-1}C_{k-1}(u)+\frac{k-u}{k-1}C_{k-1}(u-1),\qquad k\geq2.
$$
Start with $C_1=\mathbf1_{[0,1)}$. The order-two hat satisfies $C_2(1)=1$ and vanishes at its <support> endpoints. Substituting these values into the recurrence gives $C_3(1)=C_3(2)=1/2$ and then
$$
C_4(1)=\frac16,\qquad C_4(2)=\frac23,\qquad C_4(3)=\frac16.
$$
The continuous cubic <spline> is zero at $0,4$ and outside its <support>. Since $N_j(t)=C_4(t-j)$ and $x_i=i+2$, this yields the <midpoint cubic spline collocation> values
$$
\boxed{N_j(x_i)=\begin{cases}
2/3,&j=i,\\
1/6,&j=i-1\text{ or }j=i+1,\\
0,&|i-j|\geq2.
\end{cases}}
$$
Only indices $1\leq j\leq n$ are retained. In particular no nonexistent <spline> is added to an endpoint row.