Add up every date in a 31-day month
Take a calendar page for a 31-day month and add up all the date numbers, 1 + 2 + 3 + ... + 31.
What is the total, and what is the fastest way to get it without adding one by one? As a bonus, note anything special about the number you get.
Show a hint
Pair the first date with the last, the second with the second-last, and so on. Or use the formula for the sum of the first n whole numbers.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
Sign in to join the discussion · reading is open to everyone
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.
Related questions
One hundred days after a MondayAdding 1 to 100 the way Gauss did999 times 999 in your headThe person whose age is the square root of the yearThe angle between the hands at 7:20
All questions →