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.
%I A101312 #65 Feb 16 2025 08:32:55 %S A101312 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 A101312 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 A101312 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 A101312 Number of "Friday the 13ths" in year n (starting at 1901). %C A101312 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]. %C A101312 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 A101312 Every year has at least 1 "Friday the 13th," and no year has more than 3. %C A101312 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] %C A101312 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 A101312 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 %H A101312 Reinhard Zumkeller, <a href="/A101312/b101312.txt">Table of n, a(n) for n = 1901..3000</a> %H A101312 Andy Huchala, <a href="/A101312/a101312_1.sage.txt">Sage program</a> %H A101312 J. R. Stockton, <a href="https://web.archive.org/web/20150110235605/http://www.merlyn.demon.co.uk/zel-86px.htm">Rektor Chr. Zeller's 1886 Paper "Kalender-Formeln"</a> %H A101312 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Triskaidekaphobia.html">Triskaidekaphobia</a> %H A101312 Wikipedia, <a href="http://en.wikipedia.org/wiki/Triskaidekaphobia">Triskaidekaphobia</a> %H A101312 Chr. Zeller, <a href="http://dx.doi.org/10.1007/BF02406733">Kalender-Formeln</a>, Acta Mathematica, 9 (1886), 131-136. %H A101312 <a href="/index/Ca#calendar">Index entries for sequences related to calendars</a> %H A101312 <a href="/index/Rec#order_400">Index entries for linear recurrences with constant coefficients</a>, order 400. %F A101312 a(A190651(n)) = 1; a(A190652(n)) = 2; a(A190653(n)) = 3. - _Reinhard Zumkeller_, May 16 2011 %F A101312 1 <= a(n) <= 3. - _Michael S. Branicky_, Sep 09 2021 %F A101312 G.f.: x^1900 * p/q with p,q given in Sage file. - _Andy Huchala_, Mar 06 2022 %e A101312 a(1902) = 1, since only Jun 13 1902 fell on a Friday. %e A101312 a(2004) = 2, since there were 2 "Friday the 13ths" that year: Feb 13 2004 and Aug 13 2004 each fell on a Friday. %e A101312 a(2012) = 3, since Jan 13 2012, Apr 13 2012, and Jul 13 2012 are all Fridays. %t A101312 (*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 A101312 (Haskell) %o A101312 a101312 n = f 1 {- January -} where %o A101312 f 13 = 0 %o A101312 f m | h n m 13 == 6 = (f $ succ m) + 1 %o A101312 | otherwise = f $ succ m %o A101312 h year month day -- cf. Zeller reference. %o A101312 | month <= 2 = h (year - 1) (month + 12) day %o A101312 | otherwise = (day + 26 * (month + 1) `div` 10 + y + y `div` 4 %o A101312 + century `div` 4 - 2 * century) `mod` 7 %o A101312 where (century, y) = divMod year 100 %o A101312 -- _Reinhard Zumkeller_, May 16 2011 %o A101312 (Python) %o A101312 from datetime import date %o A101312 def a(n): %o A101312 return sum(date.isoweekday(date(n, m, 13)) == 5 for m in range(1, 13)) %o A101312 print([a(n) for n in range(1901, 2006)]) # _Michael S. Branicky_, Sep 09 2021 %Y A101312 Cf. A011763, A157962, A188528, A190651, A190652, A190653. %K A101312 nonn,easy %O A101312 1901,1 %A A101312 Adam M. Kalman (mocha(AT)clarityconnect.com), Dec 22 2004