"Nameless" <news.mail@[EMAIL PROTECTED]
> wrote:
> In some countries (particularly the Scandinavian ones) it
> is traditional to solve puzzles/problems (= nuts) at Easter
> time. Here's one which might be of interest to some readers.
>
> The earliest possible (Gregorian) Easter Sunday falls this
> year (2008). In what next 10 years does this recur again?
> Please feel free to display the code/link of the BASIC
> program used to compute these years. ;-)
I recently did a study of Easter date algorithms. You can download a
document containing a summary of the results (page 6) here:
http://www.sunvaley.com/TEMP/Formulas.pdf
Unfortunately, your first statement in the paragraph above is not true.
:-)
The earliest Easter can fall is March 22, not March 23, and the latest it
can fall is April 25. The PowerBasic program below calculates the dates of
Easter for all years from 1583 (first Easter in the Gregorian Calendar)
through 9999, and writes them to a text file formatted "mm dd yyyy". You
can sort the text file and easily observe, for example, that the last time
Easter fell on March 22 was 1818 and the next time will be 2285. The last
time Easter fell on March 23 was 1913 and the next time will be 2160. The
last time Easter fell on April 25 was 1943 and the next time will be 2038.
The program source and Windows 32bit executable, and the output text file
in both YYYY and MMDDYYYY sequence can be downloaded here:
http://www.sunvaley.com/TEMP/EasterRange.zip
It is unlikely that the Gregorian Calendar will remain unchanged past year
4000 or so, because of cumulative divergence from the solar year, and by
year 4000 it will be whole day off. There have already been attempts to
correct the divergence by changing the leap year rule. The current rule is
"If year is MOD 4 then it's a leap year, unless it's MOD 100 then it
isn't,
unless it's MOD 400 then it is." The new rule would add "unless it's MOD
4000 then it isn't."
Anyone interested in calendars should read Claus Tonderings Calendar FAQ:
http://www.tondering.dk/claus/calendar.html
--
Judson McClendon judmc@[EMAIL PROTECTED]
(remove zero)
Sun Valley Systems http://sunvaley.com
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."
'
' **************************************************
' * *
' * EasterRange *
' * *
' * Calculate Dates of Easter 1583-9999 *
' * *
' * Version 1.0 03-10-2008 *
' * *
' * Compile using PB/CC *
' * *
' * Judson D. McClendon *
' * Sun Valley Systems *
' * 4522 Shadow Ridge Pkwy *
' * Pinson, AL 35126-2192 *
' * 205-680-0460 *
' * *
' **************************************************
'
#COMPILE EXE
#DIM ALL
DECLARE SUB Easter(Year AS LONG, Month AS LONG, Day AS LONG)
FUNCTION PBMAIN() AS LONG
DIM Year AS LONG
DIM Month AS LONG
DIM Day AS LONG
DIM EarlyDate AS LONG
DIM LateDate AS LONG
OPEN "Easter.txt" FOR OUTPUT AS #1
FOR Year = 1583 TO 9999
Easter(Year, Month, Day)
PRINT #1, USING$("## ## ####", Month, Day, Year)
NEXT Year
CLOSE #1
END FUNCTION
'
' Modified Oudin Easter Algorithm by Claus Tonderings
'
SUB Easter(Year AS LONG, Month AS LONG, Day AS LONG)
DIM C AS LONG ' Century
DIM G AS LONG ' Golden Number - 1
DIM H AS LONG ' 23-Epact (modulo 30)
DIM I AS LONG ' Days from 21 Mar to the Paschal full moon
DIM J AS LONG ' Weekday for Paschal full moon
(Sun=0,Mon=1,...)
DIM L AS LONG ' Days from 21 Mar to Sunday <= Paschal full
moon (-6 to 28)
C = Year \ 100
G = Year MOD 19
H = (C - (C \ 4) - ((8 * C + 13) \ 25) + (19 * G) + 15) MOD 30
I = H - (H \ 28) * (1 - (29 \ (H + 1)) * ((21 - G) \ 11))
J = (Year + (Year \ 4) + I + 2 - C + (C \ 4)) MOD 7
L = I - J
Month = 3 + ((L + 40) \ 44)
Day = L + 28 - (31 * (Month \ 4))
END SUB


|