Recently I got this puzzle and I was able to solve it but brute force iteration method..( trail and error iteration). I'm wondering is it possible to come-up with like a equation which on solving will give the same answers?
Puzzle: One person had a habit of spending money according to dates. I.e. If date is 19 he was spending Rs.19 and if date is 15, he was spending Rs. 15.One night he calculated total spending of 5 consecutive days – Monday to Friday and he found that he spent Rs. 61 in 5 days.
Ans : Feb, 27, 28 Mar 1,2,3
Given that Rs.$61$ has been spent, we first note that either the days split across months, or they are all in the same month.
Suppose they are in the same month. Let us call the days as $n$, $n+1$,$n+2$, $n+3$ and $n+4$, where $n$ is the first day of spending. Then, the total of these must be $61$. This gives: $n+(n+1)+(n+2)+(n+3)+(n+4) = 61$, which simplifies to $5n=51$, and $n = 10.2$. This equation does not have a natural number solution, hence it follows that this case cannot occur.
Now, the other case must occur. However, I claim something more:
Proof: The smallest number that can be the last day of a month is $28$. Hence, the smallest possible amount of money that can be spent on the last three days of any month, is $26+27+28 = 81 > 61$. For last four or last five days, that total is even bigger, hence it follows that either the last two days or the last day of a month were included in the spending.
Suppose only one day of the previous month was part of the spending. Then, at most Rs.$31$ could have been spent on that day, and therefore the total spending is at most $31+1+2+3+4 = 41 <61$. Hence including the last day of the month was not a possibility. Hence the only option remaining is to include the last two days of the month.
Now, the first three days of the next month leads to spending of Rs.$6$. Hence, the spending of the last two days of some month is $61-6=55$. Now, suppose the last day of the month is $n$, then the amount spent in the last two days is $n+(n-1) = 2n-1$, which is equal to $55$. Hence $2n=56$, and $n=28$. Hence the previous month is a non-leap February, whose last two days are included, and the first three days of the next month, March, are to be included. Hence, the answer is Feb $27$, Feb $28$, Mar $1$, Mar $2$,Mar $3$.