wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> medium >> Calendar
(Message started by: BenVitale on May 15th, 2011, 10:10am)

Title: Calendar
Post by BenVitale on May 15th, 2011, 10:10am
2011 calendar

http://www.thfire.com/wp-content/uploads/2010/12/2011_calendar.jpg

July has 5 Fridays, 5 Saturdays and 5 Sundays.

[edit]
How often can this combination occur, and will occur?

Title: Re: Calendar
Post by towr on May 15th, 2011, 11:41am
Assuming [hide]the world started on Sunday, October 23, 4004 BC[/hide]*[hide] and ends on Friday December 21, 2012[/hide]**, then*** the combination occurs [hide]872 times. That is, interpreting the question to include the past. Under the given assumptions it will occur just once more in the future.[/hide]

It breaks down as follows,
[hide]Since 4004 BC starts in October, we can skip that year. So there are 4003 years BC to consider, and since we have to count in blocks of 400 (using the Gregorian calendar, to take into account leap years and non-leap centuries and leap 4-centuries), take the first 1997 years CE as well, this gives 6000 years for 4003-1997. In each 400 year period we have 58 Julies starting on a Friday (which is the necessary and sufficient condition for there to be 5 Fridays, Saturdays and Sundays). So this gives 15*58=870
Then to complete the past years, in 1998-2010 we have  1, and for the coming years (this one included), 2011-2012 gives 1 more. So this adds up to 872.[/hide]


*)[hide]Which it didn't.[/hide]
**)[hide]Which it won't.[/hide]
***)[hide]Actually, starting with false premises, we can deduce anything now.[/hide]

Title: Re: Calendar
Post by BenVitale on May 15th, 2011, 1:02pm
A quick search showed me that

July 2005
http://www.palestinehistory.com/issues/images/05cal.jpg

July 2016
http://www.printfree.com/Calendar_files/YearlyDecorativeCalendars/PlainWhite/2016.gif

July 2022
http://www.printfree.com/calendar_files/yearlydecorativecalendars/plainwhite/2022.gif


July 2033
http://www.printfree.com/Calendar_files/YearlyDecorativeCalendars/PlainWhite/2033plain.gif


Title: Re: Calendar
Post by towr on May 15th, 2011, 1:13pm
Did you skip 2016 for any particular reason?

For the next 400 years:
Python
Code:
from datetime import *
for i in range(2011, 2411):
 if (date(i, 7, 1).weekday() == 4):
   print i;
[hide]
2011
2016
2022
2033
2039
2044
2050
2061
2067
2072
2078
2089
2095
2101
2107[/hide]
[hide]
2112
2118
2129
2135
2140
2146
2157
2163
2168
2174
2185
2191
2196
2203
2208[/hide]
[hide]
2214
2225
2231
2236
2242
2253
2259
2264
2270
2281
2287
2292
2298
2304
2310[/hide]
[hide]
2321
2327
2332
2338
2349
2355
2360
2366
2377
2383
2388
2394
2405


[/hide]

Title: Re: Calendar
Post by BenVitale on May 15th, 2011, 1:15pm
I've just added 2005 and 2016

Title: Re: Calendar
Post by SWF on May 15th, 2011, 7:02pm
If you believe an email of facts somebody sent me, this occurs once every 823 years, and is called "Moneybags".  

The 823 years is a bit off, but maybe such months do bring enormous wealth.

Title: Re: Calendar
Post by BenVitale on May 16th, 2011, 4:57pm
Towr,
Thanks for taking the time to provide a computer solution.  Is a math solution possible?

Title: Re: Calendar
Post by technocian on Dec 13th, 2011, 9:25pm
There is no formula to bring the years for 5, Friday, Sat and Sunday in July. It was last occurred in 2005 and 2011 but next it will come in 2016, 22, 33, 39, 44, 50. You see most of the time there is a difference of 6 years but between 2022 and 2033, there was a difference of 11 years. Even after 2050, there is a difference of 11 years and next it will come in 2061.
Simple you can derive a formula from this.

Title: Re: Calendar
Post by Grimbal on Dec 14th, 2011, 1:34am
Normally the pattern repeats every 28 years.  But each turn of the century it messes up the cycle.

for this century, you can check
   year%28 in {0, 6, 17, 23}

If you add century turns, it becomes
   ((year/100)*16+year)%28 in {1, 7, 12, 18}
where (year/100) is an integer division

Even that works only 400 years.  After that you have to add another adjustment.  And after 2800 the adjustment depends on the country.


Title: Re: Calendar
Post by towr on Dec 14th, 2011, 8:52am

on 12/14/11 at 01:34:49, Grimbal wrote:
And after 2800 the adjustment depends on the country.
??
Sounds rather inconvenient to diverge in calender system after it took so long to converge on one.

Title: Re: Calendar
Post by Grimbal on Dec 14th, 2011, 3:31pm
Hm... I once heard Russia adopted the Gregorian calender quite late, during the revolution, so they had a better knowledge of the actual length of a year, and they adopted a more accurate rule for leap centuries (2 in 900 years instead of the standard 2 in 800).

But I haven't found references of the fact, except for religious calendars, such as
   http://orthodoxwiki.org/Revised_Julian_Calendar

So I am not sure Russia as a country actually adopted that alternate calendar system.



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board