%I
%S 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,
%T 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,
%U 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
%N Number of "Friday the 13ths" in year n (starting at 1901).
%C This sequence is basically periodic with period 28 [example: a(1901) = a(1929) = a(1957)], with "jumps" when it passes a nonleapyear century such as 2100 [all centuries which are not multiples of 400].
%C 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.
%C Every year has at least 1 "Friday the 13th," and no year has more than 3.
%C On average, 3 of every 7 years (43%) have 1 "Friday the 13th," 3 of every 7 years (43%) have 2 of them and only 1 in 7 years (14%) has 3 of them.
%C 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.
%C a(A190651(n)) = 1; a(A190652(n)) = 2; a(A190653(n)) = 3.  _Reinhard Zumkeller_, May 16 2011
%C Periodic with period 2800.  _Charles R Greathouse IV_, Jul 16 2012
%H Reinhard Zumkeller, <a href="/A101312/b101312.txt">Table of n, a(n) for n = 1901..3000</a>
%H J. R. Stockton, <a href="http://www.merlyn.demon.co.uk/zel86px.htm">Rektor Chr. Zeller's 1886 Paper "KalenderFormeln"</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Triskaidekaphobia.html">Triskaidekaphobia</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Triskaidekaphobia">Triskaidekaphobia</a>
%H Chr. Zeller, <a href="http://dx.doi.org/10.1007/BF02406733">KalenderFormeln</a>, Acta Mathematica, 9 (1886), 131136.
%H <a href="/index/Ca#calendar">Index entries for sequences related to calendars</a>
%H <a href="/index/Rec#order_2800">Index entries for linear recurrences with constant coefficients</a>, order 2800.
%e a(2004) = 2, since there were 2 "Friday the 13ths" that year: Feb 13 2004 and Aug 13 2004 each fell on a Friday.
%t (*Load <<Miscellaneous`Calendar` package first*) s={};For[n=1901, n<=2200, t=0;For[m=1, m<=12, If[DayOfWeek[{n, m, 13}]===Friday, t++ ];m++ ];AppendTo[s, t];n++ ];s
%o (Haskell)
%o a101312 n = f 1 { January } where
%o f 13 = 0
%o f m  h n m 13 == 6 = (f $ succ m) + 1
%o  otherwise = f $ succ m
%o h year month day  cf. Zeller reference.
%o  month <= 2 = h (year  1) (month + 12) day
%o  otherwise = (day + 26 * (month + 1) `div` 10 + y + y `div` 4
%o + century `div` 4  2 * century) `mod` 7
%o where (century, y) = divMod year 100
%o  _Reinhard Zumkeller_, May 16 2011
%o (PARI) a(n)=[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][(n+(n\100n\40015)*12)%28+1] \\ _Charles R Greathouse IV_, Jul 16 2012
%Y Cf. A157962, A188528.
%K nonn,easy
%O 1901,1
%A Adam M. Kalman (mocha(AT)clarityconnect.com), Dec 22 2004
