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-6 of 6 results.

A190651 Years with exactly one "Friday the 13th", starting from 1901.

Original entry on oeis.org

1902, 1904, 1909, 1910, 1913, 1915, 1916, 1919, 1921, 1924, 1926, 1927, 1930, 1932, 1937, 1938, 1941, 1943, 1944, 1947, 1949, 1952, 1954, 1955, 1958, 1960, 1965, 1966, 1969, 1971, 1972, 1975, 1977, 1980, 1982, 1983, 1986, 1988, 1993, 1994, 1997, 1999, 2000
Offset: 1

Views

Author

Reinhard Zumkeller, May 16 2011

Keywords

Examples

			1902 is a term, since only Jun 13 1902 fell on a Friday.
		

Crossrefs

Programs

  • Haskell
    a190651 n = a190651_list !! (n-1)
    a190651_list = filter ((== 1) . a101312) [1901..]
    
  • Mathematica
    Select[Range[1901,2001],Count[Table[DayName@{#,m,13},{m,12}],Friday]==1&] (* Giorgos Kalogeropoulos, Sep 12 2021 *)
  • Python
    from datetime import date
    def ok(n): return sum(date.isoweekday(date(n, m, 13)) == 5 for m in range(1, 13)) == 1
    print(list(filter(ok, range(1901, 2001)))) # Michael S. Branicky, Sep 12 2021

Formula

A101312(a(n)) = 1, 1 <= A101312(n) <= 3.

A190652 Years with exactly two "Friday the 13ths", starting from 1901.

Original entry on oeis.org

1901, 1905, 1906, 1907, 1908, 1911, 1912, 1917, 1918, 1920, 1922, 1923, 1929, 1933, 1934, 1935, 1936, 1939, 1940, 1945, 1946, 1948, 1950, 1951, 1957, 1961, 1962, 1963, 1964, 1967, 1968, 1973, 1974, 1976, 1978, 1979, 1985, 1989, 1990, 1991, 1992, 1995, 1996
Offset: 1

Views

Author

Reinhard Zumkeller, May 16 2011

Keywords

Examples

			2004 is a term, since only Feb 13 2004 and Aug 13 2004 fell on a Friday.
		

Crossrefs

Programs

  • Haskell
    a190652 n = a190652_list !! (n-1)
    a190652_list = filter ((== 2) . a101312) [1901..]
    
  • Mathematica
    Select[Range[1901,2020],Count[Table[{#,m,13},{m,12}],?(DayName[#] == Friday&)] == 2&] (* _Harvey P. Dale, Oct 02 2018 *)
  • Python
    from datetime import date
    def ok(n): return sum(date.isoweekday(date(n, m, 13)) == 5 for m in range(1, 13)) == 2
    print(list(filter(ok, range(1901, 2000)))) # Michael S. Branicky, Sep 12 2021

Formula

A101312(a(n)) = 2, 1 <= A101312(n) <= 3.

A190653 Years with exactly three "Friday the 13ths", starting from 1901.

Original entry on oeis.org

1903, 1914, 1925, 1928, 1931, 1942, 1953, 1956, 1959, 1970, 1981, 1984, 1987, 1998, 2009, 2012, 2015, 2026, 2037, 2040, 2043, 2054, 2065, 2068, 2071, 2082, 2093, 2096, 2099, 2105, 2108, 2111, 2122, 2133, 2136, 2139, 2150, 2161, 2164, 2167, 2178, 2189, 2192
Offset: 1

Views

Author

Reinhard Zumkeller, May 16 2011

Keywords

Examples

			2012 is a term, since only Jan 13 2012, Apr 13 2012 and Jul 13 2012 fell on Fridays.
		

Crossrefs

Programs

  • Haskell
    a190653 n = a190653_list !! (n-1)
    a190653_list = filter ((== 3) . a101312) [1901..]
    
  • Mathematica
    Module[{mos={#[[1]],Length[#]}&/@(Flatten[Take[#,1]&/@DateSelect[ DateRange[ {1900,1,1},{2200,12,1}],#Day==13&&#DayName== Friday&]]// Split)},Select[ mos,#[[2]]>2&][[All,1]]] (* Requires Mathematica version 12 or later *) (* Harvey P. Dale, Jan 17 2021 *)
  • Python
    from datetime import date
    def ok(n): return sum(date.isoweekday(date(n, m, 13)) == 5 for m in range(1, 13)) == 3
    print(list(filter(ok, range(1901, 2193)))) # Michael S. Branicky, Sep 12 2021

Formula

A101312(a(n)) = 3, 1 <= A101312(n) <= 3.

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

A188528 First month in year n with a "Friday the 13th", starting from 1901.

Original entry on oeis.org

9, 6, 2, 5, 1, 4, 9, 3, 8, 5, 1, 9, 6, 2, 8, 10, 4, 9, 6, 2, 5, 1, 4, 6, 2, 8, 5, 1, 9, 6, 2, 5, 1, 4, 9, 3, 8, 5, 1, 9, 6, 2, 8, 10, 4, 9, 6, 2, 5, 1, 4, 6, 2, 8, 5, 1, 9, 6, 2, 5, 1, 4, 9, 3, 8, 5, 1, 9, 6, 2, 8, 10, 4, 9, 6, 2, 5, 1, 4, 6, 2, 8, 5, 1, 9
Offset: 1901

Views

Author

Reinhard Zumkeller, May 16 2011

Keywords

Comments

A101312(n) > 0, therefore a(n) is defined for all n.

Examples

			Number of times all months occur on "Friday the 13th" in the past century and the current one:
          | Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
----------+------------------------------------------------
1991-2000 |  14  14   4  10  14  14   0  11  15   4   0   0
2000-2100 |  14  15   3  11  14  15   0  11  14   3   0   0
The table doesn't say that there are no "Friday the 13ths" in July, November, and December: just first occurrences are considered, e.g. Nov 13 2009 is on a Friday, but a(2009) = 2; Jul 13 2012 is on a Friday, but a(2012) = 1; and Dec 13 2024 is on a Friday, but a(2024) = 9.
		

References

  • Chr. Zeller, Kalender-Formeln, Acta mathematica, 9 (1886), 131-136.

Crossrefs

Programs

  • Haskell
    import Data.List (findIndex)
    import Data.Maybe (fromJust)
    a188528 n = succ $ fromJust $
      findIndex (\m -> h n m 13 == 6) [1..12] where
        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
    b188528 = bFileFun "A188528" a188528 1991 3000
    -- For statistics (see example) ...
    ff13_perMonth ys m = length $ filter (== m) (map a188528 ys)
    century20 = map (ff13_perMonth [1901..2000]) [1..12]
    century21 = map (ff13_perMonth [2001..2100]) [1..12]
    
  • Mathematica
    << Calendar`;
    Table[Select[ Table[ {yr,n,13},{n,12}],DayOfWeek[#]==Friday&,1][[1,2]],{yr,1901,2011}] (* Harvey P. Dale, Oct 26 2011 *)
  • Python
    from datetime import date
    def a(n):
        for month in range(1, 13):
            if date.isoweekday(date(n, month, 13)) == 5: return month
    print([a(n) for n in range(1901, 1986)]) # Michael S. Branicky, Sep 06 2021

A116386 Number of calendar weeks in the year n (starting at n=0 for the year 2000).

Original entry on oeis.org

54, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 54, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 54, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
Offset: 0

Views

Author

Sergio Pimentel, Mar 15 2006

Keywords

Comments

Since 365/7 = 52.14 > 52, every year has at least 53 weeks (although the first and / or the last calendar weeks might not be complete and belong to two different years). Only if a leap year begins in a Saturday (the last day of the calendar week), a year can have 54 different calendar weeks (being the first and last of only one day). Years with 54 calendar weeks are: 2000, 2028, 2056, 2084, 2124, 2152, etc. It happens 13 times in a 400 year cycle.

Examples

			E.g. a(0)=54 because the year 2000 had 54 calendar weeks (since Jan 01 2000 was a Saturday and Dec 31 2000 was a Sunday)
		

Crossrefs

Showing 1-6 of 6 results.