OFFSET
2,1
COMMENTS
The definition of A347113 forbids a(n) to be 1.
LINKS
Michel Marcus, Table of n, a(n) for n = 2..10000 (terms 2..1000 from N. J. A. Sloane)
MAPLE
b:= proc() true end:
g:= proc(n) option remember; local j, k; j:= g(n-1)+1;
for k from 2 do if b(k) and k<>j and igcd(k, j)>1
then b(k):= false; return k fi od
end: g(1):= 1:
a:= n-> igcd(g(n-1)+1, g(n)):
seq(a(n), n=2..100); # Alois P. Heinz, Sep 02 2021
MATHEMATICA
b[_] = True;
g[n_] := g[n] = Module[{j = g[n - 1] + 1, k},
For[k = 2, True, k++, If[ b[k] && k != j && GCD[k, j] > 1,
b[k] = False; Return[k]]]];
g[1] = 1;
a[n_] := GCD[g[n - 1] + 1, g[n]];
Table[a[n], {n, 2, 100}] (* Jean-François Alcover, May 06 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Sep 01 2021
STATUS
approved