The Gregorian calendar has a period of 400 years, so cal is a function of (year mod 400). Similarly, 'mistyped cal' is a function of (year mod 4000), so the solution set to your puzzle also depends only on the residue class of the year (mod 4000), ignoring the initial finite segment corresponding to the Julian calendar. This reduces the puzzle to a finite check. Sincerely, Adam P. Goucher
Sent: Sunday, September 13, 2015 at 5:56 PM From: "Keith F. Lynch" <kfl@KeithLynch.net> To: math-fun@mailman.xmission.com Subject: [math-fun] Calendar puzzle
I just attempted to type "cal 2015" at the command line prompt to view this year's calendar. But I mistyped it as "cal 201". However, it gave exactly the same result.
So I tried taking it a step further, with "cal 20". Not the same. Oh well.
For which years would you get the same result if you left off any number of digits from the right? Assume the "cal" command allowed years of any length, rather than being limited to four-digit years.
What about leaving digits off the left? What about deleting any subset of digits whatsoever?
(You must leave at least one digit, since "cal" with no argument shows just the current month. And the last remaining digit can't be 0 since there was no year 0.)
(Note that "cal" switches to the Julian calendar before 1752. Feel free to disregard this to make the problem more elegant, but please say so if you do so. Thanks.)
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun