Dr. David Kirkby wrote: > Dr. David Kirkby wrote: > >> Em, I thought I'd try this in Mathematica >> >> In[1]:= 5! >> >> Out[1]= 120 >> >> In[2]:= 5!! >> >> Out[2]= 15 >> >> In[3]:= 5!!! >> >> Out[3]= 1307674368000 >> >> In[4]:= 5!!!! >> >> Out[4]= 2027025 >> >> In[5]:= 5!!!!! >> <spends a long time doing whatever it is trying to compute. > >> >> >> Anyone like to guess what it's doing? > > Trying this in Wolfram Alpha > > http://www.wolframalpha.com/input/?i=5%21%21 > > reveals what Mathematica is doing. Apparently n!! is the double factorial > > http://reference.wolfram.com/mathematica/ref/Factorial2.html > > n!! = nx(n-2)x(n-2)x... > > > As a non-mathematician I'd never herd of such a thing myself. Also relevant to the discussion is
In[1]:= ?TrueQ TrueQ[expr] yields True if expr is True, and yields False otherwise. In[2]:= TrueQ[1==2] Out[2]= False In[3]:= TrueQ[5!=2] Out[3]= True In[4]:= TrueQ[5!=120] Out[4]= True In[5]:= TrueQ[5!=5] Out[5]= False And to work out the order of precedence on factorial and double-factorial. In[6]:= (5!)!! Out[6]= 959344498183598695489193994766932218518248994260838989636409419529429\ > 5395488811817369600000000000000 In[7]:= 5!!! Out[7]= 1307674368000 In[8]:= (5!!)! Out[8]= 1307674368000 In[9]:= 5!!!! Out[9]= 2027025 In[10]:= (5!!)!! Out[10]= 2027025 --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---