Solution (source code)

= Solution

Comparing the $j$th columns of $A=QR$ gives $a_j=Qr_j$. Thus
$$
\|a_j\|^2=r_j^TQ^TQr_j=r_j^Tr_j=\|r_j\|^2.
$$
Taking nonnegative square roots proves $\boxed{\|a_j\|=\|r_j\|}$. This is simply norm preservation by an orthogonal <matrix>.