Maple Some very basic Maple help (numtheory)

  • Thread starter Thread starter dkotschessaa
  • Start date Start date
  • Tags Tags
    Maple
AI Thread Summary
The discussion revolves around using Maple to implement the Pohlig-Hellman algorithm for solving discrete logarithms, specifically focusing on how to handle the output from the ifactor function. The user is seeking guidance on how to assign individual factors from the output of ifactor(p-1) to separate variables, rather than combining them into a single expression. It is clarified that ifactor returns an array of factors, and to access these factors individually, a for loop can be utilized. The conversation includes references to helpful resources, including a Maple introduction PDF and documentation on for loops in Maple, which can assist in iterating through the array of factors.
dkotschessaa
Messages
1,063
Reaction score
763
This is EXTREMELY basic. I am using maple to run a Pohlig Hellman algorithm to solve discrete logs.

If I use ifactor to get a result, i.e.


> ifactor(p-1);

(2)3 (5)

How do I assign the output of these different factors to some other variable so I can use them elsewhere?
 
Physics news on Phys.org
Not sure exactly what you're asking but I found this Maple Intro pdf that may help.

http://www.phys.unsw.edu.au/2nd_and_3rd_syllabi/mapleprimer.pdf

I hope you don't mean:

> y=ifactor(p-1)

so that y is the 2^3 * 5 value.
 
Last edited by a moderator:
jedishrfu said:
Not sure exactly what you're asking but I found this Maple Intro pdf that may help.

I hope you don't mean:

> y=ifactor(p-1)

so that y is the 2^3 * 5 value.

Not quite. I want to assign the values separately. i.e. I want to assign the 2^3 to one value and the 5 to another. (actually just the 2, I don't need 2^3, but that would have been my next question).
 
That's a step in the right direction, thanks.
 
Back
Top