birthday surprise

Here is a way to learn someone's birthday by doing a little simple math. Ask a person to take the month number (January = 1, February = 2, and so forth) of their birthday, multiply by 5, add 6, multiply the total by 4, add 9, and multiply the new total by 5 again. Finally, have her add the number of the day on which she was born and give you the total. In your head subtract 165 and you will have the month and day of her birth. How does this work? If M is the month number and D the day number, then after the seven steps the expression for their calculation is: 5(4(5M + 6) + 9) + D = 100M + D + 165. Thus, if you subtract the 165, what will remain will be the month in hundreds plus the day.