Solution (source code)

= Solution

For this part relabel one consecutive block of $k+1$ distinct knots as $t_0,\ldots,t_k$. This is a local reindexing; no extra global knot is being introduced. Let $g_t(u)=(u-t)_+^{k-1}$. Its <Lagrange interpolation polynomial> through the knot values is
$$
\ell(u)=\sum_{i=0}^kg_t(t_i)\frac{\omega(u)}{(u-t_i)\omega'(t_i)},\qquad
\omega(u)=\prod_{j=0}^k(u-t_j).
$$
Each quotient $\omega(u)/(u-t_i)$ is monic of degree $k$. Comparing <leading coefficients> gives
$$
[u^k]\ell(u)=\sum_{i=0}^k\frac{g_t(t_i)}{\omega'(t_i)}.
$$
The same <leading coefficient> is the order-$k$ <divided difference> $[t_0,\ldots,t_k]g_t$, by the <Newton interpolation polynomial> representation. Multiplying by $k$ therefore gives the explicit <B-spline> formula
$$
\boxed{M_0(t)=k\sum_{i=0}^k\frac{(t_i-t)_+^{k-1}}{\omega'(t_i)}.}
$$
Distinct knots make every denominator nonzero. For $k=1$ the degree-zero truncated power is interpreted as an interval-indicator convention; values at individual endpoints do not affect its integral.