Current location - Training Enrollment Network - Mathematics courses - How does mathematics calculate your birthday and when you are 40 years old?
How does mathematics calculate your birthday and when you are 40 years old?
If you search Baidu for the problem of how to calculate a certain day of the year, you will find that there are many solutions, among which Zeiler formula is used more. If you are really interested, you will find it very interesting.

Many people realize it through programs (C language, etc. ).

If you push the date closer, you can use the formula: m = n-1+[(n-1)/4]-[(n-1)/100]+[(n-1] All the results in the formula take the integer part and are not rounded.

Where n is the reading and c is the total number of days from New Year's Day of that year to the required date.

For example, on the day of 2011013.

m = 20 1 1- 1+20 10/4-20 100+20 10/400+ 13 = 20 10+502-20+5+ 13 = 25 10

M/7=25 10/7=358 ...

The remainder is 4, that is, 2011065438+1October 13 is Thursday.

You can try another date.