#5415: problems with multifactorial?
------------------------------------+--------------------------
       Reporter:  cwitty            |        Owner:  robertwb
           Type:  defect            |       Status:  needs_info
       Priority:  major             |    Milestone:  sage-6.10
      Component:  basic arithmetic  |   Resolution:
       Keywords:                    |    Merged in:
        Authors:                    |    Reviewers:
Report Upstream:  N/A               |  Work issues:
         Branch:                    |       Commit:
   Dependencies:                    |     Stopgaps:  todo
------------------------------------+--------------------------
Changes (by nbruin):

 * status:  new => needs_info
 * milestone:  sage-6.4 => sage-6.10


Old description:

> The multifactorial method on integers is different than the one at
> http://mathworld.wolfram.com/Multifactorial.html and
> http://www.research.att.com/~njas/sequences/A007661; unless there are
> multiple competing definitions of multifactorial, this is a bug.
>
> (The references give, for example, (5).multifactorial(3) == 10, whereas
> Sage currently returns 5.)

New description:

 The multifactorial method on integers is different than the one at
 http://mathworld.wolfram.com/Multifactorial.html and
 http://www.research.att.com/~njas/sequences/A007661; unless there are
 multiple competing definitions of multifactorial, this is a bug.

 (The references give, for example, (5).multifactorial(3) == 10, whereas
 Sage currently returns 5.)

 There are further problems: k is assumed to be a C-int. Hence,
 {{{
 sage: a=2^64
 sage: a.multifactorial(a)
 }}}
 doesn't work, whereas the appropriate value, a, would be no problem to
 represent.

 How badly do people need these numbers? for which ranges should the
 computation be optimized? The current implementation can easily be
 adjusted to give answers that agree with the definition elsewhere, fairly
 efficiently, for ranges where k fits easily in a "long".

 Indeed, the current implementation refuses to compute the multifactorial
 if n itself doesn't fit in a long. The claim in the current error message,
 "This is probably OK, since the answer would have billions of digits." is
 not quite true: if the number of digits is about (n/k) times the number of
 digits in n, so as long as n/k isn't too large, there isn't really an
 issue. It may well be that applications of multifactorial never venture in
 those ranges, though.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/5415#comment:16>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to