Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Can magma do this?

  1. May 14, 2009 #1
    if x is an integer,
    if i want to see x5 in terms of x, can it it done using magma?
    if so can somebody please give me the code?
  2. jcsd
  3. May 14, 2009 #2

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    Yes. Define a poly ring, define f to be 6x^2 + 8x+2, then evaluate f(f(f(f(f(x)))))
  4. May 14, 2009 #3
    i am totally ignorant of the code,and have absolutely no idea how to define a polyring. please, can somebody tell me the code?
  5. May 14, 2009 #4


    User Avatar
    Science Advisor

    What, you want to solve a problem by pouring molten rock on it? How do you turn in the solution to your teacher?
  6. May 14, 2009 #5

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    If you don't know how to use magma, then why do you want to use magma? Start with the magma documentation if you want magma help.

    The answer can be worked out by hand easily (if laboriously).

    If you want to learn magma this seems like a strange way to go about it.
  7. May 14, 2009 #6
    This is Mathematica code (and output). Hopefully you can convert it to the hot stuff.

    Code (Text):
    In[10]:= Expand[Nest[6*#1^2 + 8*#1 + 2 & , x, 5]]

    Out[10]= 3074457345618258602 +
       147573952589676412928*x +
       3431094397709976600576*x^2 +
       51466415965649649008640*x^3 +
       559697273626439932968960*x^4 +
       4701457098462095436939264*x^5 +
       31734835414619144199340032*x^6 +
       176808368738592374824894464*x^7 +
       828789228462151756991692800*x^8 +
       3315156913848607027966771200*x^9 +
       11437291352777694246485360640*x^10 +
       34311874058333082739456081920*x^11 +
       90068669403124342191072215040*x^12 +
       207850775545671558902474342400*x^13 +
       423124793075117102051465625600*x^14 +
       761624627535210783692638126080*x^15 +
       1213839250134242186510142013440*x^16 +
       1713655411954224263308435783680*x^17 +
       2142069264942780329135544729600*x^18 +
       2367550240199915100623496806400*x^19 +
       2308361484194917223107909386240*x^20 +
       1978595557881357619806779473920*x^21 +
       1483946668411018214855084605440*x^22 +
       967791305485446661862011699200*x^23 +
       544382609335563747297381580800*x^24 +
       261303652481070598702743158784*x^25 +
       105526475040432357168415506432*x^26 +
       35175491680144119056138502144*x^27 +
       9422006700038603318608527360*x^28 +
       1949380696559711031436247040*x^29 +
       292407104483956654715437056*x^30 +
       28297461724253869811171328*x^31 +
  8. May 24, 2009 #7
    ok, i got how to declare a polyring and defined f<x> :=6*x^2+8*x+2;
    but how to evaluate f(f(f(f(x))));
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook