Which answer did this user write?
7. Julia, 17 bytes
works due to Int64 overflowing to negative numbers

x-&gt;(x-8479)^6%5+5

Try it online!
Updated list:
58563 -&gt; 1
80214 -&gt; 2
95792 -&gt; 3
89930 -&gt; 4
86147 -&gt; 5
97857 -&gt; 6
98541 -&gt; 7

I found those numbers by guessing and brute-forcing :

for i in Iterators.product(-9999:9999,1:20,1:20)
    d = diff(((L.+i[1]) .^ i[3]) .% i[2])
    if all(==(-1), d) || all(==(1),d)
        println(i)
        println(((L.+i[1]) .^ i[3]) .% i[2])
        break
    end
end

Try it online!