Quote (Agonist @ Feb 16 2016 12:53am)
ah cool, that works
thing is, is that I don't even know what means or how it works (as in it hasn't been covered in class yet)
referring to the s::seq(numeric) and ilcm(s)
I also have to write comments and stuff explaining what each line does and I'm not sure what to do with this xD
i'm guessing ilcm= integer lcm?
and s::seq is just assigning s to a numeric sequence input?
basically?
thanks :D
there might be other ways of doing it. this just happens to be what i found within a few min of research. lcm might work instead of ilcm. i've never used maple so you'd have to try it yourself. when i did a google search of lcm, i found a matrix lcm which i discarded and a polynomial lcm, which sounds like what you tried. i found ilcm and the documentation mentioned "sequence" with as many inputs as you wanted:
http://www.maplesoft.com/support/help/Maple/view.aspx?path=igcdthe mention of "sequence" is what made me google for sequence in parameters, which provided the link i gave before:
Quote
The seq modifier allows the parameter to match multiple arguments. When a parameter with a declared type of seq(memberType) is encountered, it consumes all arguments starting from the next available one until an argument not of type memberType is encountered.
i just combined that with your existing code sample to come up with my snippet.
you may be able to use a list or array instead of a sequence. i dont know what you covered in class. you can google for examples of them if you're familiar with them.