login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A097152 Smallest prime p greater than n for which n is a quadratic residue mod p. 2

%I #16 Jul 02 2020 15:50:42

%S 7,11,5,11,19,19,17,11,13,19,13,17,31,17,17,19,23,31,29,37,29,29,29,

%T 29,37,37,29,53,37,41,41,37,37,43,37,41,43,41,41,43,47,53,53,59,53,53,

%U 59,53,71,59,53,59,67,67,61,59,61,67,61,73,67,83,67,67,97,73,83,73,73,73

%N Smallest prime p greater than n for which n is a quadratic residue mod p.

%H David A. Corneth, <a href="/A097152/b097152.txt">Table of n, a(n) for n = 2..10001</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/QuadraticResidue.html">Quadratic Residue</a>.

%t f[n_] := Block[{k = PrimePi[n]}, While[ JacobiSymbol[ n, Prime[k]] != 1, k++ ]; Prime[ k]]; Table[ f[n], {n, 2, 60}]

%o (PARI) a(n) = forprime(p = n + 1, oo, if(issquare(Mod(n, p)), return(p))) \\ _Peter Schorn_, May 13 2020

%Y Cf. A097143.

%K nonn,easy

%O 2,1

%A _Robert G. Wilson v_, Jul 27 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 06:34 EDT 2024. Contains 371920 sequences. (Running on oeis4.)