Is a "multiplcative partition" just a factorization? How about this:
sage: def mp(n): ....: return [(d,n//d) for d in n.divisors()] ....: sage: mp(12) [(1, 12), (2, 6), (3, 4), (4, 3), (6, 2), (12, 1)] where of course you could eliminate the cases d=1, d=n and so on. John On 23/01/2008, Brian Granger <[EMAIL PROTECTED]> wrote: > > Hi, > > I am working on a parallel/distributed array library for > python/ipython. For this library I need to be able to compute the > multiplicative partitions of positive integers: > > 12 => (2,6), (3,4) > > A few questions about this: > > 1) Is there a good algorithm for computing these. I can think of > silly ways of doing it, but I imagine there are more efficient ways. > > 2) Does anyone know of a implementation of such an algorithms (python, c, > etc.) > > 3) Does anyone know of a BSD license compatible (please don't shoot me > :) ) implementation. Because these distributed arrays are being > developed as a part of ipython, it needs to be BSD. > > Thanks! > > Brian > > > > -- John Cremona --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---