Chanukah Challenge

From programming_contest
Revision as of 22:38, 27 December 2017 by imported>Kmk21 (Created page with "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....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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!)