Solution (source code)

= Solution

At step $k$, choose a Householder reflection acting only on coordinates $k,\ldots,n$ that maps the trailing part of column $k$ to a multiple of the first coordinate in that block. It zeros every entry below the diagonal without changing earlier columns. Induction produces $H_n\cdots H_1A=R$ upper triangular.