A233697 Duration in months between successive instances of a given Julian calendar day of the month falling on a specified day of the week.
3, 3, 14, 3, 6, 8, 1, 8, 6, 8, 9, 6, 3, 14, 3, 3, 8, 9, 9, 8, 9, 11, 3, 6, 8, 1, 8, 9, 14, 6, 3, 14, 3, 6, 8, 6, 9, 8, 9, 6, 3, 11, 8, 1, 8, 9, 9, 8
Offset: 1
Examples
**** THIS FULL EXPLANATION IS REQUIRED TO PROVIDE AN EXAMPLE **** Designate "year 0" as any leap year, with the succeeding years as years 1, 2 and 3. The first term, 3, is the time in months between a date in January 0 (such as January 17, 2012 - a leap year) and the next time ANY "17th" falls on the same day of the week - April 17, 2012. The following tabulation identifies the remaining 47 month/year combinations within the sequence, with "year" being 0 through 3 as defined above. Jan0- 3 -Apr0- 3 -Jul0- 14 -Sep1- 3 -Dec1- 6 -Jun2- 8 -Feb3 Feb3- 1 -Mar3- 8 -Nov3- 6 -May0- 8 -Jan1- 9 -Oct1- 6 -Apr2 Apr2- 3 -Jul2- 14 -Sep3- 3 -Dec3- 3 -Mar0- 8 -Nov0- 9 -Aug1 Aug1- 9 -May2- 8 -Jan3- 9 -Oct3- 11 -Sep0- 3 -Dec0- 6 -Jun1 Jun1- 8 -Feb2- 1 -Mar2- 8 -Nov2- 9 -Aug3- 14 -Oct0- 6 -Apr1 Apr1- 3 -Jul1- 14 -Sep2- 3 -Dec2- 6 -Jun3- 8 -Feb0- 6 -Aug0 Aug0- 9 -May1- 8 -Jan2- 9 -Oct2- 6 -Apr3- 3 -Jul3- 11 -Jun0 Jun0- 8 -Feb1- 1 -Mar1- 8 -Nov1- 9 -Aug2- 9 -May3- 8 -Jan0 **** EXAMPLE **** It is December 13, 2013 - and a Friday. When are the next 5 "Friday the 13ths"? SOLUTION. 2013 is a "year 1". Locate December for year 1 in the table in the fifth column of months, first entry. By inspection it is 6 months to the next Friday the 13th in June 2014. Reading the next four entries, the remaining four events are in February 2015 (as "Feb3"), March 2015 ("Mar3"), November 2015 ("Nov3") and May 2016 ("May0").
Programs
-
PARI
{a(n, list = 0) = if(n<1 || n>48, return); \\ calculate (\list) up to n-th term my(daysmod7 = [3, 0, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3], \\ days beyond 28 in months s = 0, c = 1, yr = 0, mo = 1, months = 0); \\ yr = 0 means (Julian) leap year while(1, \\ find next cumulative whole week(s) months++; s = (s + daysmod7[mo] + (mo==2 && yr==0))%7; \\ count elapsed months if(s==0, if(list, print1(months, ", ")); \\ print if optional list <> 0 if(c==n, return(months), c++; months = 0)); \\ return n-th or continue if(mo<12, mo++, mo = 1; yr = (yr + 1)%4))} \\ new month or new month/year a(48, 1) \\ print all 48 terms (and return 48th) - Rick L. Shepherd, Jul 06 2017
Formula
Brute force calculation is more efficient than employing a formula, one that would be most involved and hence not meaningful in its individual terms. Calendar consultation provides a simple alternative.
Extensions
Lightly edited and terms/examples checked by Rick L. Shepherd, Jun 29 2017
Comments