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!)
A034795 a(n) is the least prime > a(n-1) that is a quadratic residue mod a(n-1). 2
2, 3, 7, 11, 23, 29, 53, 59, 71, 73, 79, 83, 109, 113, 127, 131, 151, 167, 173, 179, 191, 193, 197, 223, 227, 239, 241, 251, 263, 269, 283, 293, 307, 311, 313, 317, 353, 383, 389, 409, 419, 431, 433, 439, 443, 457, 461, 467, 479, 487, 491, 503, 509, 523, 547 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
MAPLE
f:= proc(p) local q;
q:= p;
do
q:= nextprime(q);
if NumberTheory:-QuadraticResidue(q, p)=1 then return q fi
od
end proc:
A[1]:= 2: for i from 2 to 100 do A[i]:= f(A[i-1]) od:
seq(A[i], i=1..100); # Robert Israel, Jan 06 2023
MATHEMATICA
a[1] = 2; a[2] = 3; a[n_] := a[n] = For[p = NextPrime[a[n-1]], True, p = NextPrime[p], If[JacobiSymbol[p, a[n-1]] == 1, Return[p]]];
a /@ Range[55] (* Jean-François Alcover, Dec 28 2019 *)
CROSSREFS
Cf. A034795.
Sequence in context: A095766 A126755 A228592 * A165318 A108184 A049091
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Name corrected by Robert Israel, Jan 06 2023
STATUS
approved

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 20 10:22 EDT 2024. Contains 371814 sequences. (Running on oeis4.)