OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Plot a(n) at (x,y) = (a(n) mod 1000, -floor(a(n)/1000) - 1), n = 1..10^6 in white.
EXAMPLE
Let s = A373390.
a(1) = 2 since s(2) | s(4), i.e., 2 | 4.
a(2) = 3 since s(3) | s(5), i.e., 3 | 9.
a(3) = 4 since s(4) | s(6), i.e., 4 | 8.
a(4) = 5 since s(5) | s(7), i.e., gcd(9, 15) = 3.
9 is not in the sequence since a(9) = 5 and a(11) = 7 are coprime.
MATHEMATICA
c[_] := False; p[_] := False; nn = 90;
Array[Set[{a[#], c[#], p[#]}, {#, True, True}] &, 3]; i = a[2]; j = a[3]; u = 4;
Reap[Do[k = u;
While[Or[c[k], ! CoprimeQ[j, k], NoneTrue[Set[s, #], p] &@
FactorInteger[k][[All, 1]]], k++];
Map[Set[p[#], True] &, s]; If[! CoprimeQ[i, k], Sow[n - 2]];
Set[{a[n], c[k], i, j}, {k, True, j, k}];
If[k == u, While[c[u], u++]], {n, 4, nn}] ][[-1, 1]]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael De Vlieger, Jul 01 2024
STATUS
approved