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”).

A034901
a(n) is square mod a(i), i < n; a(n) nonsquare; a(1) = 2.
2
2, 3, 6, 7, 15, 21, 30, 39, 51, 120, 204, 480, 816, 849, 2041, 2185, 4785, 19140, 21505, 43065, 44080, 49504, 59185, 172260, 176320, 178465, 236740, 387585, 443521, 552601, 1774084, 2210404, 2310385, 3991689, 4973409, 5371081, 7096336
OFFSET
1,1
PROG
(PARI) isok(newa, v, n) = {for (k=1, n, if (!issquare(Mod(newa, v[k])), return (0)); ); return (1); }
nextnonsq(n) = my(k=n); while (issquare(k), k++); k;
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
CROSSREFS
Cf. A000037 (nonsquares), A034900, A034902.
Sequence in context: A265394 A125167 A137604 * A343149 A275390 A109976
KEYWORD
nonn
STATUS
approved