%I #10 Apr 25 2024 12:14:10
%S 1,0,1,1,1,1,1,0,1,1,2,1,0,1,1,1,2,1,0,1,1,2,1,1,1,1,1,2,1,0,1,1,1,1,
%T 1,0,1,1,2,1,0,1,1,1,2,1,0,1,1,2,1,1,1,1,1,2,1,0,1,1,1,1,1,0,1,1,2,1,
%U 0,1,1,1,2,1,0,1,1,2,1,1,1,1,1,2
%N Periodic sequence S_{31} of length 28: used to compute the number that the day 31 of a month occurs on a day of the week for the Gregorian cycle of 400 years.
%C For the Gregorian Calendar (in use since Friday, October 15, 1582) of period 400, the number of occurrences of day d = 31 of a month on a day D of the week from 0 to 6 (0 for Sunday) can be given for the representative years y from 0 to 399 (for years congruent to modulo 400, and y >= 1583) by pieces of the present sequence S_{31} with period length 28.
%C This is done with the help of the seven length 400 codes M(31, D), for D from 0..6, shown in Table 3 of the linked WL paper. The meaning of these codes and their encoding in terms of the periodic sequence of length 28, S_{31} (the S_{31} 'clock') see Figure 4 of the linked paper, is explained there and in A370558 (the case M(1, D)).
%H Wolfdieter Lang, <a href="https://arxiv.org/abs/2311.13646">Four Sequences of Length 28 and the Gregorian Calendar</a>, arXiv:2311.13646v2 [math.HO], 2023.
%H <a href="/index/Rec#order_25">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1).
%F {a(n)}_{n>=0} = repeat(1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 1, 2, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 2,).
%F From _Chai Wah Wu_, Apr 25 2024: (Start)
%F a(n) = a(n-1) - a(n-4) + a(n-5) - a(n-8) + a(n-9) - a(n-12) + a(n-13) - a(n-16) + a(n-17) - a(n-20) + a(n-21) - a(n-24) + a(n-25) for n > 24.
%F G.f.: (-2*x^24 + x^23 - 2*x^20 + x^19 - x^18 + x^17 - 2*x^16 + 2*x^15 - 2*x^14 - x^12 + 2*x^11 - 2*x^10 + x^9 - 2*x^8 + x^7 - x^6 + x^5 - x^4 - x^2 + x - 1)/(x^25 - x^24 + x^21 - x^20 + x^17 - x^16 + x^13 - x^12 + x^9 - x^8 + x^5 - x^4 + x - 1). (End)
%e In the following S_{31}(i..j) means the subsequence S_{30}(i), S_{30}(i+1)}, ..., S{31}(j), i.e., a(i), a(1+1), ..., a(j).
%e 1) M(31, 0) = (0)102(17)99(17)99(17)100.
%e decoded by the four pieces:
%e S_{31}, S_{31}, S_{31}, S_{31}(0..17);
%e S_{31}(6..27), S_{31}, S_{31}, S_{31}(0..20);
%e S_{31}(9..27), S_{31}, S_{31}, S_{31}(0..23);
%e S_{31}(12..27), S_{31}, S_{31}, S_{31}.
%e For example in the year 2024 == 24 mod 400 there is S_{31}(24) = 1 Sunday on the 31th day of a month (indeed, this month is March).
%e For 2106 == 106 mod 400 there will be S_{31)(10) = 2 Sundays on the 31th day of a month (in January and Oktober). Because the second piece starts with a(102) = S_{31}(6).
%e 2) M(31, 6) = (12)101(17)100(17)101(17)98.
%e decoded by the four pieces:
%e S_{31}(12..27), S_{31}, S_{31}, S_{31}, S_{31}(0);
%e S_{31}(17..27), S_{31}, S_{31}, S_{31} S_{31}(0..4);
%e S_{31}(21..27}, S_{31}, S{31}, S_{31}, S_{31}(0..9);
%e S_{31}(26..27), S_{31}, S{31}, S_{31}, S_{31}(0..11).
%e For 2024 == 24 mod 400 there is S_{31}(24 - (27-11)) = S_{31}(8) = 1 Saturday on the 31th day of a month (in August).
%e For 2113 == 113 mod 400 there will be S_{31)(1) = 0 Saturdays on a 31th in 2113. S_{31)(1) comes from the second entry of the second part of the second piece.
%Y Cf. A370558, A370559, A370560.
%K nonn,easy
%O 0,11
%A _Wolfdieter Lang_, Apr 16 2024