The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A034902 a(i) is a square mod a(j), i <> j; a(n) prime; a(1) = 2. 2

%I #23 Sep 04 2023 14:32:03

%S 2,7,113,233,337,2129,3833,8737,19553,46337,72689,103681,361649,

%T 449689,477017,668273,3095353,7212577,13188281,26340857,46012633,

%U 246116833,330177017,354681097,1014496289,1315295809,2269762961,4651240801,14947292497

%N a(i) is a square mod a(j), i <> j; a(n) prime; a(1) = 2.

%t a[1] = 2; squareModQ[p_, q_] := (For[k=0, k <= q, k++, If[Mod[p-k^2, q] == 0, Return[True]]]; Return[False]); a[n_] := a[n] = For[r=NextPrime[a[n-1]], True, r=NextPrime[r], If[And @@ (squareModQ[r, #] && squareModQ[#, r] & /@ Array[a, n-1]), Return[r]]]; Table[Print[a[n]]; a[n], {n, 1, 10}] (* _Jean-François Alcover_, Dec 10 2014 *)

%o (PARI) isok(newp, v, n) = {for (k=1, n, if (!issquare(Mod(newp, v[k])) || !issquare(Mod(v[k], newp)), return (0));); return (1);}

%o lista(nn) = {my(v=vector(nn), lastp=2); v[1] = lastp; for (n=2, nn, my(newp = nextprime(lastp+1)); while (! isok(newp, v, n-1), newp = nextprime(newp+1)); v[n] = newp; lastp = newp;); v;} \\ _Michel Marcus_, Sep 25 2020

%Y Cf. A034900, A034901.

%K nonn,nice,more

%O 1,1

%A _David W. Wilson_

%E a(24)-a(29) from _Sean A. Irvine_, Sep 20 2020

%E Name edited by _Michel Marcus_, Sep 24 2020

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 May 12 19:25 EDT 2024. Contains 372494 sequences. (Running on oeis4.)