A101312 Number of "Friday the 13ths" in year n (starting at 1901).
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
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.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1901..3000
- Andy Huchala, Sage program
- J. R. Stockton, Rektor Chr. Zeller's 1886 Paper "Kalender-Formeln"
- Eric Weisstein's World of Mathematics, Triskaidekaphobia
- Wikipedia, Triskaidekaphobia
- Chr. Zeller, Kalender-Formeln, Acta Mathematica, 9 (1886), 131-136.
- Index entries for sequences related to calendars
- Index entries for linear recurrences with constant coefficients, order 400.
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
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
Comments