You are viewing a single comment's thread. Return to all comments →
While I agree this works, not sure if this is what was intended from the prompt. In the last section it describes: "Once we hit n=10, we print the first ten terms as a single line of space-separated integers.", which would imply that they want you to do the entire series calculation first, then print the result.
Seems a bit weird that this is where it is in the challenge list, as I would think a recursive solution is called for in that case.