I am putting the input into variable $n ...: $n =

...simulating the machine language program at the bottom of this page...