A company decides that whenever Xmas falls on a Sunday they will give their workers all extra paid holidays so that, together with any public holidays, workers will not have to work the following week (between the 25th of December and the first of January).



Task

In what years between 2008 and 2121 will the 25th of December be a Sunday?

Using any standard date handling libraries of your programming language;
compare the dates calculated with the output of other languages to discover any anomalies in the handling of dates which may be due to, for example, overflow in types used to represent dates/times similar to   y2k   type problems.




Declare Function modulo(x As Double, y As Double) As Double
Declare Function wd(m As Double, d As Double, y As Double) As Integer
 
Cls
Dim yr As Double
For yr = 2008 To 2121
	If wd(12,25,yr) = 1 Then
		Print "Dec " & 25 & ", " & yr
	EndIf
Next
Sleep
 
Function modulo(x As Double, y As Double) As Double
	If y = 0 Then
		Return x
	Else
		Return x - y * Int(x / y)
	End If
End Function
 
Function wd(m As Double, d As Double, y As Double) As Integer
	If m = 1 Or m = 2 Then
		m += 12
		y-= 1
	End If
	Return modulo(365 * y + Fix(y / 4) - Fix(y / 100) + Fix(y / 400) + d  + Fix((153 * m + 8) / 5), 7) + 1
End Function
 
Dec 25, 2011
Dec 25, 2016
Dec 25, 2022
Dec 25, 2033
Dec 25, 2039
Dec 25, 2044
Dec 25, 2050
Dec 25, 2061
Dec 25, 2067
Dec 25, 2072
Dec 25, 2078
Dec 25, 2089
Dec 25, 2095
Dec 25, 2101
Dec 25, 2107
Dec 25, 2112
Dec 25, 2118