Solution (source code)

= Solution

For symmetric $A$, apply at stage $k$ the same reflection on both sides, choosing it to zero entries below the first subdiagonal in column $k$. <Orthogonal similarity> preserves symmetry, so the corresponding row entries vanish too and previous zeros remain. After finitely many stages $Q A Q^T$ is symmetric tridiagonal. Constructing each reflector uses only arithmetic and one square root.