Formal development of the non-recursive algorithm for the Hanoi tower problem