Anneau Z/pZ p premier

Petit programme sous scilab abouti

format(25)

b=997

A=zeros(b,b);

for i=1:b

for j=1:b

A(i,j)=modulo(i*j,b);

end

end

calculpi=0;

B=matrix(A,1,b^2);

indice=find(B==0);

for i=(1:b^(4))

C=(1:b^2)+(i-1)*b^2;

D=C(indice);

calculpi=calculpi+sum(D.^-2);

end

calculpi=calculpi*(b^2-b+1)

(%pi^2/6)/calculpi

Leave a Reply

Your email address will not be published. Required fields are marked *