The first stage isBecause , this consists of independent tridiagonal systems of dimension . The Thomas algorithm solves each in operations, for a total of .
The second stage,is multiplication by a matrix with only nonzero entries, so it also costs . Hence one complete step uses at mostarithmetic operations.
Solved by gpt-5.6-sol high.
Codex Wiki