# [seqfan] Re: Primes of the form 8n + 7 or -x + 4xy + 4y^2

jean-paul allouche jean-paul.allouche at imj-prg.fr
Mon Nov 14 10:07:52 CET 2016

```Nice! I was trying to concoct something on the same
lines but I was much too slow  :-)))

best wishes
jean-paul

Le 14/11/16 à 08:54, Don Reble a écrit :
> Alonzo and all:
>
>> ... does not guarantee that for every n there are x and y that
>> will give the same value as 8n + 7 in -x^2 + 4xy + 4y^2.
>> So that's what I'm going to be thinking about now.
>
>
>    Z = (-x^2 + 4xy + 4y^2) is a primitive quadratic form with
>    discriminant 32. The QF theory shows that there are essentially
>    two such forms, A = (8u^2 - v^2) and B = (u^2 - 8v^2).
>        (Substitute x->2u+v, y->u to show that Z is like A.)
>    Every primitive, discr=32 form is like A or B: that is,
>    the range of each such form is the same as A's range or B's range.
>
>
>    If P is a 8n+7 prime, then 2 is a quadratic residue (QR theory):
>    there exists a T, 0<T<P, such that T^2 == 2 mod P.
>    P divides T^2 - 2, and U = (16T^2 - 32)/4P is an integer.
>
>    The form C = (Px^2 + 4Txy + Uy^2) has discriminant 32, is primitive,
>        (T < P and P is an odd prime; therefore gcd(P,4T)=1)
>    and represents P (at x=1 y=0).
>    C isn't like form B (B doesn't represent any 8n+7 numbers)
>    so it is like form A, and A represents P.
>
>
>    8n+1 primes also have quadratic residue 2, so analogously
>    form B represents all of those primes.  A007519 = A141174.
>

```