My codes are not running and I don't know why

Hello every one, I was making a challenge which I would return the sequence of sums of powers of a number passed to the function, and mention whether it is a winning or not.that is the winning has 1 in the sequence, and nonwinnig has 4 in the sequence. the I decided the following way and my codes are not running the any thing.

When I use the inner loop is is right I get the sum of the squares of the number, by thinking how to make the continuous sequence to get every sum on each level the outer loo gives me nothing. is there some body to give me a hand.
Thank you
Capture

please post your code, not a screenshot

I am not going to retype your code to debug it, please provide your code so that it can be copied and pasted for debugging

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums