%I #17 Mar 05 2024 16:31:39
%S 7,2,3,4,5,7,1,2,3,5,6,7,1,3,4,5,6,1,2,3,4,6,7,1,2,4,5,6,7,2,3,4,5,7,
%T 1,2,3,5,6,7,1,3,4,5,6,1,2,3,4,6,7,1,2,4,5,6,7,2,3,4,5,7,1,2,3,5,6,7,
%U 1,3,4,5,6,1,2,3,4,6,7,1,2,4,5,6,7,2,3,4,5,7,1,2,3,5,6,7,1,3,4,5,6,7,1,2,3
%N Day of the week corresponding to Jan 01 of a given year (n=0 for the year 2000).
%C The number of days in the 400 year cycle of the Gregorian calendar is 365 * 400 + 100 (leap year every 4 years) - 4 (no leap year in centuries) + 1 (leap year every 400 years) = 146097 days. Since 146097 is (coincidentally) divisible by 7 (7 * 20871), the cycle repeats exactly every 400 years. As a consequence, the probability of Jan 01 of a given year being any given weekday is not 1/7. Sunday, Tuesday and Friday have the highest probability (14.50%); Wednesday and Thursday 14.25%; Monday and Saturday 14.00%.
%D N. Dershowitz and E. M. Reingold, Calendrical Calculations, Cambridge University Press, 1997.
%H N. Dershowitz and E. M. Reingold, <a href="http://emr.cs.iit.edu/home/reingold/calendar-book/first-edition/">Calendrical Calculations Web Site</a>
%H PandaWave Company, <a href="http://www.pandawave.com/index2.html">World Calendars</a>
%H E. G. Richards, <a href="http://www.users.zetnet.co.uk/egrichards/book.htm">Mapping Time, The Calendar and its History</a>, Oxford University Press, Great Clarendon Street, Oxford OX2 6DP, Reprinted 1999 (with corrections) page 231-5, 290, 311, 321.
%H <a href="/index/Ca#calendar">Index entries for sequences related to calendars</a>
%F 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday and 7 = Saturday. a(n+400) = a(n) since the cycle repeats every 400 years.
%e a(6) = 1 because Jan 01 2006 was a Sunday.
%t (* first do *) Needs["Miscellaneous`Calendar`"] (* then *) Table[DayOfWeek[{2000 + n, 1, 1}], {n, 0, 104}] /. {Sunday -> 1, Monday -> 2, Tuesday -> 3, Wednesday -> 4, Thursday -> 5, Friday -> 6, Saturday -> 7} (* _Robert G. Wilson v_, Apr 04 2006 *)
%o (Python)
%o from datetime import date
%o def a(n): return (date(2000+n, 1, 1).isoweekday())%7 + 1
%o print([a(n) for n in range(105)]) # _Michael S. Branicky_, Jan 05 2021
%Y Cf. A060512, A053401, A101944.
%K nonn
%O 0,1
%A _Sergio Pimentel_, Mar 15 2006
%E More terms from _Robert G. Wilson v_, Apr 04 2006
|