Justin C. Walker on Sat, 24 Sep 2005 07:41:10 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: 2 questions ...



On Sep 23, 2005, at 19:14 , Quique Becerra wrote:

Hi
I'm new to PARI and need to make 2 functions (to do programming)

If you are comfortable reading english (and your message seems to indicate that you are), you should spend some time reading the documentation provided with Pari/gp. It should be helpful for these kinds of questions.

1) X^M mod N
(using 3 parameters)

f(X,M,N)=Mod(X^M,N);

2) a function to factorize a natural number...
with natural i refer to:
numbers from 1 to infinite

This is provided by Pari/gp:

? factor(327685558)
%3 =
[2 1]

[29 2]

[194819 1]

In both cases, I have used the syntax for 'gp', the command-line interpreter. The library syntax (for C programming) is a bit different (and is discussed in the documentation).

Hope this helps.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for General Semantics
--------
Men are from Earth.
Women are from Earth.
   Deal with it.
--------