OFFSET

1,1

COMMENTS

In the first 100000 terms the fixed points are 10, 16, 42, 52, 66; it is likely no more exist. The sequence is conjectured to be a permutation of the positive integers > 1.

LINKS

Scott R. Shannon, Image for n = 1..100000. The green line is a(n) = n.

EXAMPLE

a(6) = 7 as |7 - a(5)| = |7 - 13| = 6 which shares a common factor with a(4) = 8.

MATHEMATICA

nn = 120; c[_] = False; Array[Set[{a[#], c[# + 1]}, {# + 1, True}] &, 2]; i = 2; j = 3; u = 4; Do[k = u; While[Or[c[k], CoprimeQ[i, #]] &[Abs[k - j]], k++]; Set[{a[n], c[k], i, j}, {k, True, j, k}]; If[k == u, While[c[u], u++]], {n, 3, nn}], n]; Array[a, nn] (* Michael De Vlieger, Feb 26 2023 *)

CROSSREFS

KEYWORD

nonn

AUTHOR

Scott R. Shannon, Feb 25 2023

STATUS

approved