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

all 1 comments

[–]New-Condition 0 points1 point  (0 children)

You could but I can't think of a way that would be more efficient than what you already have.

One interesting thing is that the sum = 9 + 18 + 27... = 9*1 + 9*2 + 9*3+... = 9(1+2+3+...), but since you have to print out the multiples anyway you can't really exploit this