# [seqfan] Some strange primes...

David Harden oddleehr at alum.mit.edu
Tue Dec 23 06:50:36 CET 2008

```This is the sequence of odd primes p such that the sum of (a/p), taken from a=1 to k, is positive for all integers k such that 1 <= k <= p-2. (Here (a/p) denotes the Legendre symbol.)

If p == 1 (mod 4), then the above sum vanishes for k=(p-1)/2. Therefore all terms have p == 3 (mod 4).
Additionally, if p > 3 is in this sequence, p == 7 (mod 8) because otherwise the sum vanishes at k=2.

This sieving can be extended further: the next opportunity for the sum to vanish (assuming it doesn't at k=2) is when k=6, and this happens iff (3/p) = (5/p) = -1. This means that if p > 7 is in the sequence, then we cannot have p == 7 or 103 (mod 120). I do not know what happens when this sieving is extended further. It looks messy, since there are more residue classes corresponding to the information about the quadratic residues ( (-1/p)= -1 and (2/p) = 1 means p == 7 (mod 8) while, for example,  (3/p)=1 and (5/p) = -1 implies p == 13, 37, 23, or 47 (mod 60) )and more possibilities for the information about quadratic residues (p > 7 in this sequence could have (3/p) = (5/p) = 1, (3/p) = 1 and (5/p) = -1, or (3/p) = -1 and (5/p) = 1, while (-1/p) = -1 and (2/p) = 1 are forced).

Here are some notes about verifying the membership of p in this sequence:

1. It suffices to check the condition for k with 1 <= k <= (p-1)/2. This is because p == 3 (mod 4) means that the sum, taken up to k = (p-1)/2 + d (where d is a nonnegative integer), equals the sum, taken up to k = (p-1)/2 - d.

2. It suffices to check the condition for l with 1 <= k <= A, where A is the ((p+1)/4)th quadratic residue modulo p. This is because of #1 and the fact that (p+1)/4 > ((p-1)/2)/2. This should actually be a slight improvement on #1, since an exercise in Ireland and Rosen (if I remember correctly) says that any prime == 3 (mod 4) has more quadratic residues on the interval (0,p/2) than it does on the interval (p/2,p).

3. Dirichlet's class number formula, giving the class number of Q(sqrt(-p)), for p > 3, and p == 3 (mod 4), as 1/p times [the sum of the quadratic nonresidues mod p on (0,p) minus the sum of the quadratic residues mod p on (0,p)], should say something about members of this sequence, but I am not sure what that would be.

Finally, here are the first 8 members of this sequence, according to my hand computation: 3, 7, 23, 31, 47, 71, 79, 151. To facilitate checking, these hand computations also say that the 8th quadratic residue mod 31 is 10, the 12th QR mod 47 is 17, the 18th QR mod 71 is 27, the 20th QR mod 79 is 32, and the 38th QR mod 151 is 68.

I do not know whether this sequence is finite or infinite, and I am not practiced enough in number theory to see where that problem would lead.

---- David
```