(49G) Friday 13th calculation

06212014, 02:09 PM
(This post was last modified: 06152017 01:46 PM by Gene.)
Post: #1




(49G) Friday 13th calculation
The programme returns the dates of Friday 13th for a valid year entry using dd.mmyyyy format.
The programme works for versions 1.196 & 2.108. Eg For 1,953 the programme returns 13.021953, 13.031953 & 13.111953. :: CK1&Dispatch BINT1 :: % 1000000. %/ %13 %+ BINT12 ZERO_DO % .01 %+ DUP % 13.063 DDAYS %7 %MOD %0= IT DUP LOOP DROP ; ; Improvements welcome. 

06222014, 06:16 AM
Post: #2




RE: HP 49G Friday 13th calculation
Here's my ancient User RPL version, which was included in "OneMinute Marvels" by Richard Nelson and Wlodek MierJedrzejowicz:
Code: << 1000000 / 1.13 + 13 FOR d 6.133 d DDAYS 7 MOD NOT d IFT NEXT >> Since there are not many ways of doing it, the code looks very much like yours. Same input as yours: Just the desired year. However, my version assumes MDY mode. Changing it to DMY is left as an exercise for the student. <0ɸ0> Joe 

06222014, 06:23 AM
Post: #3




RE: HP 49G Friday 13th calculation
Is this from Conway? Is there a pointer to a formula or discussion on this?
It ain't OVER 'till it's 2 PICK 

06222014, 07:13 AM
Post: #4




RE: HP 49G Friday 13th calculation
(06222014 06:16 AM)Joe Horn Wrote: Here's my ancient User RPL version, which was included in "OneMinute Marvels" by Richard Nelson and Wlodek MierJedrzejowicz: I probably copied Joe Horn's prog some time ago. Credit to him. 

06232014, 08:11 AM
(This post was last modified: 06242014 03:03 PM by Werner.)
Post: #5




RE: HP 49G Friday 13th calculation
Such a program should of course be independent of the date format setting.
Try this: Code: \<< Cheers, Werner 

06232014, 10:21 PM
Post: #6




RE: HP 49G Friday 13th calculation
(06222014 06:16 AM)Joe Horn Wrote: "OneMinute Marvels" "OneMinute Marvels" = pretty cool. ...I like PUSH POPs Thanks ~~~~8< Art >8~~~~ PS: Please post more 50G stuff :) 

06242014, 12:32 AM
Post: #7




RE: HP 49G Friday 13th calculation
(06232014 10:21 PM)CosmicTruth Wrote: "OneMinute Marvels" = pretty cool. Indeed! These are the very reason I, and a whole bunch of other folks, decided learning RPL was worth the time and effort. These and the EduCalc Technical Notes (also avail at hpcalc.org) are your best tools if trying to convince a friend (or yourself) to learn RPL. Real Good Stuff!! Bob Prosperi 

06242014, 05:03 AM
Post: #8




RE: HP 49G Friday 13th calculation
(06232014 08:11 AM)Werner Wrote: Such a program should of course be independent from the date format setting. Now THAT is a thing of beauty. <0ɸ0> Joe 

06242014, 07:30 AM
Post: #9




RE: HP 49G Friday 13th calculation
Thanks, Joe.
I missed the obvious shortcut: take 5. 6. START NEXT i.o. 1 12 START NEXT Now it's 86.5 bytes  shorter than your original ;) Code: \<< Cheers, Werner 

06242014, 02:05 PM
(This post was last modified: 06242014 10:17 PM by Alberto Candel.)
Post: #10




RE: HP 49G Friday 13th calculation
Those are pretty. Some time ago I read somewhere, I forget where, that over the years, the most frequent day for a 13th was a Friday, or the other way around. It should be easy to verify with these programs. Good for a coffee break.


06242014, 09:24 PM
Post: #11




RE: HP 49G Friday 13th calculation
<0ɸ0> Joe 

06242014, 10:16 PM
Post: #12




RE: HP 49G Friday 13th calculation
(06242014 02:05 PM)Alberto Candel Wrote: Those are pretty. Some time ago I read somewhere, I forget where, that over the years, the most frequent day for a 13th was a Friday, or the other way around. It should be easy to verify with these programs. Good for a coffe break. Unless my User RPL has bugs, you're right. The calendar repeats exactly every four centuries, so all we need to do is tally all 4800 13ths from 2000 through 2399. Here's what I got: 684 Thursdays & Saturdays 685 Mondays & Tuesdays 687 Sundays & Wednesdays 688 Fridays! <0ɸ0> Joe 

« Next Oldest  Next Newest »

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