Maple -- computing all possible divisors of an integer

Discussion in 'Undergraduate Math' started by Jenny C, Oct 24, 2006.

  1. Jenny C

    Jenny C Guest

    Hey,
    When using maple to find all divisors of a large integer, how do we compute
    these divisors from the knowledge of its prime factorisation. I'm sure the
    first step would be to use the ifactor command but then what's next...
    Any suggestions....?
    Thanks
     
    Jenny C, Oct 24, 2006
    #1
    1. Advertisements

  2. If you know the prime factorizatio of n,


    n = p_1^{a_1} * ... * p_r^{a_r}

    where p_i is a prime, p_i different from p_j, and a_i are positive
    integers, then every divisor must be of the form

    d = p_1^{b_1}* ... * p_r^{b_r}, with b_i integers satisfying
    0<= b_i <= a_r

    If you know the primes and the exponents for n, this can easily be
    done with some recursion.

    --
    ======================================================================
    "It's not denial. I'm just very selective about
    what I accept as reality."
    --- Calvin ("Calvin and Hobbes" by Bill Watterson)
    ======================================================================

    Arturo Magidin
    magidin-at-member-ams-org
     
    Arturo Magidin, Oct 24, 2006
    #2
    1. Advertisements

  3. Take the prime factors 1 at a time, 2 at a time, 3 at a time, .......
     
    Pubkeybreaker, Oct 24, 2006
    #3
  4. if you know the prime factorisation already you just modify/iterate the
    exponents for each factor.
    if you are factorization is: p_1^k_1*....p_n^k_n then you create all
    products p_1^i_1*....p_n^i_n with 0<=i_j<=k_j for j=1..n
    programmatically you could do that with loop(s) or a recursion, however
    in maple yopu could use the "seq" command as well.
     
    kilian heckrodt, Oct 25, 2006
    #4
  5. small addendum:
    if your goal is only to get all divisors of a number, you can use the
    "divisor" command of maple directly.
     
    kilian heckrodt, Oct 25, 2006
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.