@lizettegagne re-tweeted as follows earlier today (or yesterday +/-): "RT @mashable: Happy Palindrome Day everyone - 01022010! Last one was 10022001, prior to that 08311380!! Wow! They don't come around often." I hacked up the following Prolog code to get some certainty. Simple modification reveals that European ordering or YYYYMMDD ordering would lead to entirely different results. Try it out! PF ?- main. 08311380 10022001 01022010 true. % This is what a palindrom is ... palindrom(S) :- reverse(S,S). % Generate all palindrom dates; ignoring leap years. special(MDYS) :- year(_,YS), month(M,MS), day(M,_,DS), append(MS,DS,MDS), append(MDS,YS,MDYS), palindrom(MDYS). % Here is an over-approximation of dates. year(X,S) :- ranges(4,1380,2010,X,S). month(X,S) :- ranges(2,1,12,X,S). day(1,X,S) :- ranges(2,1,31,X,S). day(2,X,S) :- ranges(2,1,29,X,S). day(3,X,S) :- ranges(2,1,31,X,S). day(4,X,S) :- ranges(2,1,30,X,S). day(5,X,S) :- ranges(2,1,31,X,S). day(6,X,S) :- rang...
Very much looking forward to reading it once it's done.
ReplyDeletethis is a cool sideThanksfor the great content
ReplyDeletelive bait and tackle