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(n) is square mod a(i), i < n; a(n) nonsquare; a(1) = 2.
2

%I #15 Sep 25 2020 07:32:37

%S 2,3,6,7,15,21,30,39,51,120,204,480,816,849,2041,2185,4785,19140,

%T 21505,43065,44080,49504,59185,172260,176320,178465,236740,387585,

%U 443521,552601,1774084,2210404,2310385,3991689,4973409,5371081,7096336

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

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

%o nextnonsq(n) = my(k=n); while (issquare(k), k++); k;

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

%Y Cf. A000037 (nonsquares), A034900, A034902.

%K nonn

%O 1,1

%A _David W. Wilson_