From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_40,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11390f,be6b7e036aa9236c X-Google-Attributes: gid11390f,public X-Google-Thread: 10261c,323208040e431277,start X-Google-Attributes: gid10261c,public X-Google-Thread: 101deb,be6b7e036aa9236c X-Google-Attributes: gid101deb,public X-Google-Thread: 1014db,be6b7e036aa9236c X-Google-Attributes: gid1014db,public X-Google-Thread: fa0ae,be6b7e036aa9236c X-Google-Attributes: gidfa0ae,public X-Google-Thread: 103376,be6b7e036aa9236c X-Google-Attributes: gid103376,public X-Google-Thread: 1164ba,be6b7e036aa9236c X-Google-Attributes: gid1164ba,public X-Google-Thread: 1094ba,be6b7e036aa9236c X-Google-Attributes: gid1094ba,public From: Dr John Stockton Subject: Re: Friday 13th, try it yourself (was Language Wars..) Date: 1996/09/22 Message-ID: #1/1 X-Deja-AN: 184609916 distribution: inet x-nntp-posting-host: merlyn.demon.co.uk references: <51bv60$8d@pheidippides.axion.bt.co.uk> organization: Home, Surrey, UK mime-version: 1.0 newsgroups: comp.lang.pascal.misc,comp.lang.ada,comp.lang.apl,comp.lang.basic,comp.lang.c,comp.lang.fortran,comp.lang.perl.misc,comp.lang.pl1,comp.lang.rexx,comp.lang.smalltalk Date: 1996-09-22T00:00:00+00:00 List-Id: In article <521pfp$kec@ns.ccsn.edu> of Sat, 21 Sep 1996 17:16:25 in comp.lang.pascal.misc, Russell Mosemann wrote: >Clinton Pierce writes: > >>See for yourself if the "Friday the 13th" thing is just a UL. If you trust >>UNIX's 'cal' program, and that it does the Right Thing with Leap Years, the >>Gregorian/Julian switch etc..etc... This Perl script will show you the Truth: > > I decided to write a script of my own for Solaris 2.4 and perl >5.003 which calls cal for 1066 to 1996 and rips out the Fridays. The >following is the number of times a particular day of the month falls >on a Friday. The results are pretty evenly distributed, i.e. it is an >Urban Legend. ... You need to test over 400 years, rather than over a more-or-less arbitrary period, because in the Gregorian calendar the length-of-month rule repeats every 400 years, and 400 years happens to be an integer number of weeks. You will then find that Friday 13th is slightly more common that one might at first expect. Authority for this is excellent. A.D. 2000 is a leap year. After (in the U.K.) 1752, every year divisible by 4 is leap, EXCEPT if it is divisible by 100 but not by 400; so that: Leap := (Year mod 4 = 0) xor (Year mod 100 = 0) xor (Year mod 400 = 0) ; For proof, read any of the following : RGO, UK : http://www.ast.cam.ac.uk:80/pubinfo/leaflets/leapyear/leapyear.html http://www.ast.cam.ac.uk:80/pubinfo/leaflets/2000/2000.html http://www.ast.cam.ac.uk:80/pubinfo/leaflets/calendar/calendar.html Claus Tondering : ftp://login.dknet.dk/pub/ct/calendar.faq ftp://garbo.uwasa.fi/pc/doc-net/calfaq.zip Prof. Timo Salmi : ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip any reputable encyclopaedia; or even Windows Calendar, set to Feb 2000. The Gregorian Calendar repeats every 400 years, which is 146097 days (in Octal, 435261 days) or exactly 20871 (Octal, 50607) weeks. BTW, February 29th, in a "century" year, is always Tuesday 29/02/00. -- John Stockton, Surrey, UK. JRS@merlyn.demon.co.uk Turnpike v1.12 MIME http://www.merlyn.demon.co.uk/