OFFSET
1,3
LINKS
Michael De Vlieger, Annotated scatterplot of a(n), n = 1..300000, showing even terms in red, odd in blue, with positions of zeros in italic.
MATHEMATICA
nn = 2^20; c = {1}; j = 1; u = 2; {1}~Join~Reap[Do[k = u; While[Nand[FreeQ[c, k], CoprimeQ[j, k], k != j + 1, k != j - 1], k++]; j = k; AppendTo[c, k]; Sow[k - i]; If[k == u, While[MemberQ[c, u], u++]; c = DeleteCases[c, _?(# < u &)]], {i, 2, nn}]][[-1, -1]]
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Michael De Vlieger, May 05 2022
STATUS
approved