Ahmad Kamal on Wed, 11 Jul 2012 13:41:43 +0200


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

Re: Hello


i forget to tell you that the program works only at n less than or equal 4

On 11 July 2012 11:34, Ahmad Kamal <drkamal.mtc@gmail.com> wrote:
Hi , i want to ask please about the command      x=random(p)    :

what if i want to be sure that x has an inverse Mod p .

cause in the following program it always give an error :


n=5;
p=281040463189842761944876463095882573657425678131112457182259869008082819;
X=listcreate(n);
for(x=1,n,listput(X,random(p),x)) ;

invX=listcreate(n);
for(x=1,n,listput(invX,lift(Mod(X[x],p)^-1),x)) ;