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.

Showing 1-2 of 2 results.

A101312 Number of "Friday the 13ths" in year n (starting at 1901).

Original entry on oeis.org

2, 1, 3, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 3, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 3, 1, 1, 3, 2, 1, 3, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 3, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 3, 1, 1, 3, 2, 1, 3, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 3, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 3, 1, 1, 3, 2, 1, 3, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 3, 1, 1, 2, 2, 1, 2, 1
Offset: 1901

Views

Author

Adam M. Kalman (mocha(AT)clarityconnect.com), Dec 22 2004

Keywords

Comments

This sequence is basically periodic with period 28 [example: a(1901) = a(1929) = a(1957)], with "jumps" when it passes a non-leap-year century such as 2100 [all centuries which are not multiples of 400].
At these points [for example, a(2101)], the sequence simply "jumps" to a different point in the same pattern, "dropping back" 12 entries [or equivalently, "skipping ahead" 16 entries], but still continuing with the same repeating [period 28] pattern.
Every year has at least 1 "Friday the 13th," and no year has more than 3.
On average, 171 of every 400 years (42.75%) have 1 "Friday the 13th," 170 of every 400 years (42.5%) have 2 of them and only 59 in 400 years (14.75%) have 3 of them. [Corrected by Pontus von Brömssen, Sep 09 2021]
Conjecture: The same basic repeating pattern results if we seek the number of "Sunday the 22nds" or "Wednesday the 8ths" or anything else similar, with the only difference being that the sequence starts at a different point in the repeating pattern.
Periodic with period 400. (Because the number of days in 400 years is 400*365 + 97 = 146097, which happens to be divisible by 7.) - Pontus von Brömssen, Sep 09 2021

Examples

			a(1902) = 1, since only Jun 13 1902 fell on a Friday.
a(2004) = 2, since there were 2 "Friday the 13ths" that year: Feb 13 2004 and Aug 13 2004 each fell on a Friday.
a(2012) = 3, since Jan 13 2012, Apr 13 2012, and Jul 13 2012 are all Fridays.
		

Crossrefs

Programs

  • Haskell
    a101312 n = f 1 {- January -} where
       f 13                = 0
       f m | h n m 13 == 6 = (f $ succ m) + 1
           | otherwise     = f $ succ m
       h year month day  -- cf. Zeller reference.
         | month <= 2 = h  (year - 1)  (month + 12)  day
         | otherwise  = (day + 26 * (month + 1) `div` 10 + y + y `div` 4
                        + century `div` 4 - 2 * century) `mod` 7
           where (century, y) = divMod year 100
    -- Reinhard Zumkeller, May 16 2011
    
  • Mathematica
    (*Load <
    				
  • Python
    from datetime import date
    def a(n):
        return sum(date.isoweekday(date(n, m, 13)) == 5 for m in range(1, 13))
    print([a(n) for n in range(1901, 2006)]) # Michael S. Branicky, Sep 09 2021

Formula

a(A190651(n)) = 1; a(A190652(n)) = 2; a(A190653(n)) = 3. - Reinhard Zumkeller, May 16 2011
1 <= a(n) <= 3. - Michael S. Branicky, Sep 09 2021
G.f.: x^1900 * p/q with p,q given in Sage file. - Andy Huchala, Mar 06 2022

A157962 Table read by rows: Occurrences of Friday the 13th, T(n,1)=month (1 for January), T(n,2)=year-2000, starting year 2000.

Original entry on oeis.org

10, 0, 4, 1, 7, 1, 9, 2, 12, 2, 6, 3, 2, 4, 8, 4, 5, 5, 1, 6, 10, 6, 4, 7, 7, 7, 6, 8, 2, 9, 3, 9, 11, 9, 8, 10, 5, 11, 1, 12, 4, 12, 7, 12, 9, 13, 12, 13, 6, 14, 2, 15, 3, 15, 11, 15, 5, 16, 1, 17, 10, 17, 4, 18, 7, 18, 9, 19, 12, 19, 3, 20, 11, 20, 8, 21, 5, 22, 1, 23, 10, 23, 9, 24, 12, 24
Offset: 1

Views

Author

Pierre CAMI, Mar 10 2009

Keywords

Comments

Uses the Gregorian calendar.

Examples

			a(39) = 1, a(40) = 12 -> Jan 2012,
a(41) = 4, a(42) = 12 -> Apr 2012,
a(43) = 7, a(44) = 12 -> Jul 2012,
a(45) = 9, a(46) = 13 -> Sep 2013.
		

Crossrefs

Programs

  • Haskell
    a157962 n = a157962_list !! (n-1)
    a157962_list = concat $ map (t 1 {- January -}) [0..] where
       t 13 _                       = []
       t m n | h (n+2000) m 13 == 6 = m : n : t (succ m) n
             | otherwise            = t (succ m) n
       h year month day  -- cf. Zeller reference.
            | month <= 2 = h  (year - 1)  (month + 12)  day
            | otherwise  = (day + 26 * (month + 1) `div` 10 + y + y `div` 4
                           + century `div` 4 - 2 * century) `mod` 7
              where (century, y) = divMod year 100
    -- Reinhard Zumkeller, May 17 2011
  • Mathematica
    << Calendar`; {y, m} = {2000, 1}; A157962 = {}; Do[ If[ m == 12, y = y + 1; m = 1, m = m + 1]; If[ DayOfWeek[ {y, m, 13}] == Friday, AppendTo[ A157962, {m , y - 2000}]] , {300}]; Flatten[A157962] (* Jean-François Alcover, Dec 16 2011 *)
    Flatten[Table[If[DateValue[{2000+n,m,13},"DayName"]==Friday,{m,n},{}], {n,0,25},{m,12}]/.{}->Nothing] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 10 2017 *)
  • VBA
    jo = 6 For a = 2000 To 2399 For b = 1 To 31 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And b = 13 Then ll = ll + 1: Cells(ll, 1) = 1: Cells(ll, 2) = a - 2000 Next b If a - 4 * Int(a / 4) = 0 Then GoTo 10 For c = 1 To 28 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And c = 13 Then ll = ll + 1: Cells(ll, 1) = 2: Cells(ll, 2) = a - 2000 Next c GoTo 20 10 For c = 1 To 29 jo = jo + 1: If jo = 7
    Then jo = 0 If jo = 6 And c = 13 Then ll = ll + 1: Cells(ll, 1) = 2: Cells(ll, 2) = a - 2000 Next c 20 For d = 1 To 31 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And d = 13 Then ll = ll + 1: Cells(ll, 1) = 3: Cells(ll, 2) = a - 2000 Next d For e = 1 To 30 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And e = 13 Then ll = ll + 1: Cells(ll, 1) = 4: Cells(ll, 2) = a - 2000 Next e For f = 1 To 31 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And f = 13 Then ll = ll + 1: Cells(ll, 1) = 5: Cells(ll, 2) = a - 2000 Next f For g = 1 To 30 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And g = 13 Then ll = ll + 1: Cells(ll, 1) = 6: Cells(ll, 2) = a - 2000 Next g For h = 1 To 31 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And h = 13 Then ll = ll + 1: Cells(ll, 1) = 7: Cells(ll, 2) = a - 2000 Next h For i = 1 To 31 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And i = 13
    Then ll = ll + 1: Cells(ll, 1) = 8: Cells(ll, 2) = a - 2000 Next i For j = 1 To 30 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And j = 13 Then ll = ll + 1: Cells(ll, 1) = 9: Cells(ll, 2) = a - 2000 Next j For k = 1 To 31 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And k = 13 Then ll = ll + 1: Cells(ll, 1) = 10: Cells(ll, 2) = a - 2000 Next k For l = 1 To 30 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And l = 13 Then ll = ll + 1: Cells(ll, 1) = 11: Cells(ll, 2) = a - 2000 Next l For m = 1 To 31 jo = jo + 1: If jo = 7 Then jo = 0 If jo = 6 And m = 13 Then ll = ll + 1: Cells(ll, 1) = 12: Cells(ll, 2) = a - 2000 Next m Next a End Sub
    

Formula

a(2n+1) = a(2n + 1377), a(2n) = a(2n + 1376) + 400. - Charles R Greathouse IV, May 17 2011
Showing 1-2 of 2 results.