login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Smallest prime p == 7 mod 8 (A007521) and p > prime(n+2) such that p is a quadratic residue mod the first n odd primes 3, 5, 7, 11, ..., prime(n+1), and p is a quadratic non-residue mod prime(n+2).
1

%I #10 Mar 07 2013 17:12:55

%S 23,7,31,79,631,751,2311,21319,48799,82471,256279,78439,1768831,

%T 1365079,2631511,1427911,4355311,5715319,49196359,117678031,180628639,

%U 475477759,452980999

%N Smallest prime p == 7 mod 8 (A007521) and p > prime(n+2) such that p is a quadratic residue mod the first n odd primes 3, 5, 7, 11, ..., prime(n+1), and p is a quadratic non-residue mod prime(n+2).

%C Same as smallest prime p == 7 mod 8 with the property that the Legendre symbol (p|q) = 1 for the first n odd primes q = prime(k+1), k = 1, 2, ..., n, and (p|q) = -1 for q = prime(n+2).

%t f[n_] := Block[{k = 2}, While[ JacobiSymbol[n, Prime[k]] == 1, k++ ]; Prime[k]]; t = Table[0, {50}]; Do[p = Prime[n]; If[Mod[p, 8] == 7, a = f[p]; If[ t[[ PrimePi[a]]] == 0, t[[ PrimePi[a]]] = p; Print[ PrimePi[a], " = ", p]]], {n, 10^9}]; t

%Y Cf. A096635, A096636.

%K nonn

%O 0,1

%A _Robert G. Wilson v_, Jun 24 2004

%E Better name from _Jonathan Sondow_, Mar 07 2013