Could someone please help me with this procedure please. Testing weather numberss are prime of not.
local minus1, d, test,r,p,q,i,w:
while ((d mod 2) = 0) do
test:=Power(a,d) mod n:
for i from 0 to q do
w:=a^(2^(i)*d) mod n:
if (test = 1) and ( w = minus1 or w = 1) then
printf(" Therefore %a is either a Prime or %a is a Miller Rabin Liar",n,a):
printf(" %a cannot be a Prime ",n)
Error, (in Miller_Rabin) improper op or subscript selector
I don't really understand why this is happening. it works for some numbers but not for all.