Money in the Bank
You save money every day for n days. On the first Monday you put in 1 dollar and each following day of that week 1 dollar more than the day before (Tuesday 2, ..., Sunday 7). Every new Monday you put in 1 dollar more than the previous Monday. Day 1 is a Monday. Return the total saved after n days.
Example 1
n 10
returns 37
28 for week one, then 2 + 3 + 4 = 9: 37.
Constraints
1 <= n <= 1000
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Math problems
- Next PrimeEasy
- Nim GameEasy
- Perfect NumberEasy
- Perfect Square CheckEasy
- Polygon AreaEasy
- Prime FactorizationEasy
- Pythagorean TriplesEasy
- Rectangle OverlapEasy