User blog comment:Kyodaisuu/Update of Bashicu Matrix Calculator/@comment-25337554-20170503095939/@comment-24061664-20170503101117

Major loop corresponds to each step of calculation. In the example calculation, 3 steps are shown and therefore I think there are 3 time loops. Please note that the calculation step is shown at line 218, and after that it goes straight to the end of the loop at line 240.

n is actually the length of the sequence, which becomes longer in most cases, which makes this loop appears to be "never ending loop", but the point is that expected to end (although it is not proven yet).