Slashdot Mirror


User: thisisjoel

thisisjoel's activity in the archive.

Stories
0
Comments
1
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1

  1. "Crunching" the numbers on This Rare Friday the 13th · · Score: 3, Informative
    If anyone else wants to "crunch" those numbers, here's some Perl:
    use Date::Calc qw( Add_Delta_Days Day_of_Week );

    my $MAX_YEAR=3000;
    my @date = (1,1,1);

    sub summer { $a = 0; foreach (@_) { $a += $_ } $a }

    while( $date[0] < $MAX_YEAR ) {
    @date = Add_Delta_Days( @date, 1 );
    if( $date[2] == 13
    && Day_of_Week( @date ) == 5
    && summer( split '', sprintf( "%04d-%02d-%02d", @date ) ) == 13
    ) {
    printf( "%04d-%02d-%02d\n", @date );
    }
    }
    I get 2006-01-13 as the most recent occurrence.