OFFSET
1,2
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 black.
EXAMPLE
Let s = A373390.
a(1) = 1 since gcd(s(1), s(3)) = gcd(1, 3) = 1.
a(2) = 9 since gcd(s(9), s(11)) = gcd(5, 7) = 1.
8 is not in the sequence since gcd(s(8), s(10)) = gcd(14, 6) = 2.
MATHEMATICA
c[_] := False; p[_] := False; nn = 222;
Array[Set[{a[#], c[#], p[#]}, {#, True, True}] &, 3]; i = a[2]; j = a[3]; u = 4;
{1}~Join~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