Hello all,

So first a little bit about my problem. I've recently been studying C and programming in general. My maths background is pretty poor and I didn't take too well to it in school. So I always avoided programming up till now. I have been lurking on programming forums and Reddit for a while and watched quite a few tutorials and attempted to write basic strings of code e.g "Hello, world" etc.. Sooo my problem is I have now completely hit a brick wall, I started following a Computer Science course on Github provided by the OSS university.

https://github.com/open-source-socie...an-oss-student

Everything was going fine and I have been taking notes constantly, which i can look back on and understand.
I completed the first week in the CS50 course then the second jumped to a problem set that i can not get my head around. I have looked at quite a few explanations of Nested loops, Do while loops and while loops, but when it comes to construct one for a problem like this:https://youtu.be/z32BxNe2Sfc I just can't seem to get my head round it at all and even writing the psudocode for it just won't go in.

I'm not asking for anyone to tell me exactly what to do. Just a few explanations of how to contemplate this type of function. I also understand if you think this post is a complete waste of time and don't want to help, feel free to ignore.
Any help will be much appreciated and I will keep researching in the meantime as much as I can.

Here is the start of my code:
https://github.com/ashzor1337/test/blob/master/pset1.c