login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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