Post Reply 
Friday the 13th on 17bii Solver
01-13-2017, 07:37 PM (This post was last modified: 01-14-2017 09:13 PM by Don Shepherd.)
Post: #1
Friday the 13th on 17bii Solver
My brother-in-law called me today with a question about dates and days. He asked if there is a way to determine how many times Friday the 13th occurs in a given year (other than looking at the calendar for the current year, obviously).

I was aware of this site which has a very good algorithm for determining what day of the week a given date falls on. It occurred to me that this would be an excellent equation for the 17bii solver, making use of its included functions like sigma, IDIV, MOD, and of course L() and G().

The equation determines how many times a given day of the month (1-31) falls on a given day in a given year. You input the YEAR, day-of-month (DOM, 1-31), and DAY (0=Sunday, 6=Saturday), and solve for ANS.

For 2017, there are two Friday-the-13th's.

\(\Sigma\)(M:1:12:1:0xL(A:IDIV(14-M:12))xL(Y:YEAR-G(A))xL(MM:M+12xG(A)-2)+IF(MOD(DOM+G(Y)+IDIV(G(Y):4)-IDIV(G(Y):100)+IDIV(G(Y):400)+IDIV(31xG(MM):12):7)=DAY:1:0))-ANS
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Friday the 13th on 17bii Solver - Don Shepherd - 01-13-2017 07:37 PM



User(s) browsing this thread: 1 Guest(s)