The bouncing sequence
Haskell, 61 bytes



f n=[i|i&lt;-[2..],gcd i n&lt;2,all((/=i).f)[2..n-1],abs(n-i)&gt;1]!!0


Try it online!

I'm fairly new to Haskell, so any golfing tips are appeciated.

Thanks to Wheat Wizard for 2 bytes and nimi for 4 bytes

Explanation:

f n=[i|i&lt;-[2..],gcd i n&lt;2,all((/=i).f)[2..n-1],abs(n-i)&gt;1]!!0
f n=                                                          -- define a function f :: Int -&gt; Int
    [i|i&lt;-[2..],                                              -- out of positive integers greater than two
                gcd i n&lt;2,                                    -- gcd of i and n is 1
                          all((/=i).f)[2..n-1],               -- i isn't already in the sequence
                                               abs(n-i)&gt;1]    -- and |n-i| &gt; 1
                                                          !!0 -- take the first element