september 9 5 6
october 10 0 1
november 11 3 4
december 12 5 6
Assume sunday - 0 , monday -1 and so on till saturday - 6
first digits are the month represented in numbers
Now last 2 digits
second digit is a normal year and third digits are leap year.
January 1 0 0
Normal year Sunday - 0 , Leap year - 0
Add 31 days
Feb 2 3 3
Normal year 3 wednesday , Leap 3 wednesday.
Add 28 for normal and 29 for leap
March 3 3 4
Normal year 3 wednesday , Leap 4 thursday
Add 31 days
April 4 6 0
Normal year 6 saturday , leap year 0 sunday
And continue so on. ...
If you don't get it take any normal calender year whose jan month starts from sunday and also any other calender of leap year whose jan month starts on sunday you will get the logic.
This only works for 2012 and 2017.