OFFSET
1,1
COMMENTS
Understanding this sequence is the key to analyzing A359804.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..16383
EXAMPLE
b(1)=1, b(2)=2, b(3)=3, b(4)=5, so a(2) = smallest prime not dividing 2, which is 3. a(3) = smallest prime not dividing 2*3, which is 5, and a(4) = smallest prime not dividing 3*5, which is 2.
MATHEMATICA
nn = 120; c[_] = False; q[_] = 1;
Array[Set[{a[#], c[#]}, {#, True}] &, 2];
Set[{i, j}, {a[1], a[2]}]; u = 3;
{2}~Join~Reap[Do[
(k = q[#]; While[c[k #], k++]; k *= #;
While[c[# q[#]], q[#]++]) &[(p = 2;
While[Divisible[i j, p], p = NextPrime[p]]; p)]; Sow[p];
Set[{a[n], c[k], i, j}, {k, True, j, k}];
If[k == u, While[c[u], u++]], {n, 3, nn}] ][[-1, -1]] (* Michael De Vlieger, Mar 18 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Mar 18 2023
STATUS
approved