Need help solving this COMPLEX javascript problem!

My professor just gave me this assignment, and I can't understand it for the life of me. He says in the comments that it's a "simple for loop exercise" but the comments are very complicated and I don't understand the math well enough to find the solution. Please help me.

Need help solving this COMPLEX javascript problem My professor just gave me this assignment and I cant understand it for the life of me He says in the comments class=