cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Adam Helman

Adam Helman's wiki page.

Adam Helman has authored 2 sequences.

A233697 Duration in months between successive instances of a given Julian calendar day of the month falling on a specified day of the week.

Original entry on oeis.org

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

Author

Adam Helman, Dec 14 2013

Keywords

Comments

A 28-year cycle exists as derived by multiplication of 4 years / leap cycle by 7 days of the week. Within such a cycle there are exactly 48 days when a given day of the month (selected from 1 to 28) falls on a specific day of the week.
Fewer days result for the choices of 29, 30 and 31, each with their own unique sequence that repeats after 28 years. These results may be published as their own related yet nonetheless unique sequences.
The average duration between such events is simply 7 months as trivially derived. However, the *actual* durations vary from 1 to 14 months with the following frequencies:
separation (months) number of instances
1 3
3 10
6 8
8 12 (modal value)
9 9
11 2
14 4
The entire sequence of 48 time separations in months between successive instances of a given day of the month falling on a specified day of the week is provided above.
(Account is not taken of the extra non-leap years introduced with the Gregorian calendar; i.e., those divisible by 100 yet NOT by 400, e.g., A.D. 2100, 2200 and 2300. Thus, the method in the example does not work without modification for time durations including such years or years such as A.D. 2201, 2202 or 2203; in these cases, the previous leap year is 4, 5, 6 or 7 years earlier.)

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").
		

Crossrefs

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

A176360 a(n) = quadrant of unit circle corresponding to n radians.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 1, 2, 2, 3, 4, 4, 1, 1, 2, 3, 3, 4, 1, 1, 2, 3, 3, 4, 4, 1, 2, 2, 3, 4, 4, 1, 2, 2, 3, 3, 4, 1, 1, 2, 3, 3, 4, 1, 1, 2, 2, 3, 4, 4, 1, 2, 2, 3, 4, 4, 1, 1, 2, 3, 3, 4, 1, 1, 2, 3, 3, 4, 4, 1, 2, 2, 3, 4, 4, 1, 2, 2, 3, 3, 4, 1, 1, 2, 3, 3, 4, 1, 1, 2, 2, 3, 4, 4, 1, 2, 2, 3, 4, 4, 1, 1, 2, 3, 3
Offset: 1

Author

Adam Helman, Apr 15 2010, Apr 20 2010

Keywords

Comments

Radians are the natural measure of angle. Quadrants (1 through 4) determine the signs of (x,y); of (cos x, sin x); and are ubiquitous.
Thereby it is "interesting" to consider which quadrant contains successively larger integer radian measure.

Examples

			a(11) is very nearly 7 quadrants as Pi is nearly exactly 22/7.
Indeed, 11 radians lies just 4.4 milliradian (0.25 degree) within the 4th quadrant.
		

Programs

  • End
    
    				
  • Mathematica
    Table[Mod[1+Floor[(2n)/Pi],4],{n,120}]/.(0->4) (* Harvey P. Dale, Apr 09 2020 *)
  • Other
    # a(n) = 1 + {floor [2*n/pi] modulo(4)}
    # Ruby code by Andy Martin
    # Overkill here, 4 places properly gives first 200 terms.
    t = 2000000000000000000000000000000000000000000000000000000000000000000
    pi = 3141592653589793238462643383279502884197169399375105820974944592307
    (1..200).each{ |n| print "#{1 + ((n*t)/pi)%4},"}
    print "\b \n"
    

Formula

a(n) = 1 + {floor [2*n/Pi] modulo(4)}. - Adam Helman, Apr 20 2010