Chanukah Challenge

From programming_contest
Jump to navigation Jump to search

This problem asks how many hannukah candles we would have to light if it were a different number of days.

If we're really lazy, we can brute force it and iterate day by day. If we're a little less lazy, it's just

sum(1..n) + n

If you don't how to sum the numbers from one to N, perhaps send Professor Astrachan an email. (or you could brute force/precompute them!)