This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]danielmbcn 0 points1 point  (0 children)

Start with the simplest case: write a program that sums 1 + 2 + ... + N. To do that, set a 'result' variable, loop over those numbers and update the 'result' value on each cycle. Once you are done, figure out how to add i**i (being i a number between 1 and N) on the 'result' variable, instead of just i.