Dear David,

the amount of counterexamples sounds impressively.

I suppose that there are a lot of p=1 mod 4.

I think that i will publish soon a test which separates between p=1 mod 4 and p=3 mod 4,

but i would like to check first some list by myself in order to save some time for you and to get

some more informations.

How does it feel to be a "keeper" of such a lot of interesting gremlins :-)

A new and better proposition:

A. Let p an element of N with p=3 mod 4,

m the greatest power of 2 with 2^m*r=p+1

and 2^m < r

1. choose a prime a with jacobi (a, p)=-1

2. Verify a^(p-1)/2=-1 mod p

3. Depending on the a choose the pell solution of x, y with

x^2-ay^2=1 mod p

http://mathworld.wolfram.com/PellEquation.html

4. Verify that (x+yA)^(2^m)<>1 mod p with A=sqrt (a)

because gcd (p-1, p+1) = 2

5. Calculate and verify (x+yA)^p=x-yA mod p

6. Calculate (x+yA)^r=x(r)+y(r)A mod p and

verify that gcd (y(r), p)=1

(The point 6. derives of a factorisation test, is cheap and powerful

because gcd (y(n), p) > 1 results gcd (y(m), p) > 1 with m=n*t)

if 1.-6. is ok. then p is a prime.

David, you will realize that i abstain form the choose of the smallest a

and that i add the point 4. for good reasons

I wish you a peaceful and pleasant weekend

Bernhard