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

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
Showing 1-2 of 2 results.