[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

1385.0. "JRM: Day of Week; very large numbers contest" by CIVAGE::LYNN (Lynn Yarbrough @WNP DTN 427-5663) Mon Feb 11 1991 15:31

The most recent issue (Vol 22, No. 4) of Journal of Recreational 
Mathematics has some interesting stuff, of which perhaps the most useful is
the following very compact computation for the weekday of a given (modern)
date (for Sunday=0, Saturday=6, etc.; in C language notation): 

	(23*m/9+d+4+(m<3?y--:y-2)+y/4-y/100+y/400)%7

The derivation of the 23m/9 term etc. is explained in detail in the paper
by Michael Keith and Tom Craver on JRM p. 280. 

======================================================================

This issue also contains the results of a contest to find the largest 
number that can be written using only the four digits 1,2,3,4 (once each)
and the four signs .-() (as often as desired). Exponentiation (by vertical 
position) is permitted; i.e.

	  (4-.1)
	 3
	2

is admissible. Math noters here might want to try their hand at this before
I publish the contest results.

Lynn 
T.RTitleUserPersonal
Name
DateLines
1385.1how about this oneVMSDEV::HALLYBThe Smart Money was on GoliathMon Feb 11 1991 16:177
    Can the 4 digits be combined, as in:
    
    			  41
    			 3
    			2		?
    
      John
1385.2JARETH::EDPAlways mount a scratch monkey.Mon Feb 11 1991 16:2311
    The C expression in .0 would seem to be flawed since order of:
    
    	the decrement of y in y-- and
    	the use of the value of y in its other apperaances
    
    is not guaranteed.  Actually, I might guess "y--" should be "y-1":
    
	(23*m/9+d+4+(m<3?y-1:y-2)+y/4-y/100+y/400)%7

    
    				-- edp
1385.3Well...CIVAGE::LYNNLynn Yarbrough @WNP DTN 427-5663Mon Feb 11 1991 18:158
Re .1: Yes, 2^(3^41) is 3rd or 4th on the list.

Re .2: Assuming the order of operations is left-to-right without 
'optimizing' the order, it works. In fact, the formula *depends* on the 
decrementation occuring at that specific point in the expression, and
thus affecting the remaining subexpression evaluations. In this respect, 
it's something like an APL one-liner, in which assignments to variables in 
the midst of an expression are common.
1385.5(10/3)^(5^10000)HERON::BUCHANANHoldfast is the only dog, my duck.Mon Feb 11 1991 19:2613
>Re .1: Yes, 2^(3^41) is 3rd or 4th on the list.

	Well, my guess is:

	(.3)^(-((.2)^(-((.1)^(-4)))))

=	(3/10)^(-((1/5)^(-((1/10)^(-4)))))
=	(10/3)^(5^(10^4))

Any good? :-)

Regards,
Andrew.