— Burt Kaliski Jr. (@modulomathy) September 19, 2013
Yes, day 29*M is always in month M:
- Day 29: January 29
- Day 58: February 27
- Day 87: March 28
- Day 116: April 26
- Day 145: May 25
- Day 174: June 23
- Day 203: July 22
- Day 232: August 20
- Day 261: September 18
- Day 290: October 17
- Day 319: November 15
- Day 348: December 14
In a leap year, the dates from March onward would be one day later, but would still remain in the month.
What about other multiples of M? We need a multiplier K such that K*M falls in December; if that happens then most of the others should fall into place (though we’ll have to check February because it is shorter than the others).
In a non-leap year, the first day of December is Day 335, which gives a minimum value for K of 28, because 28*12 = 336. The last day of December is Day 365, which gives a maximum value for K of 30.
We know that 29 works. What about 28 and 30?
To check 28, subtract one day per month off each of the dates above. This will work, because the day part of each of the dates is greater than the month part.
To check 30, add one day per month. This will be a problem for February: Day 30*2 = 60 in a non-leap year falls on March 1.
In a leap year, both 28 and 30 would work. Day 30*2, the only questionable case, would fall on February 29.