I am looking for a special function, which could change itself (for example other constants set) so that part of its output would change in a special way.
Let it be such that at the beginning, the function would be just identity x -> x for x in some finite range [0, n] , x € N
After inserting the element n+1 to the position i < n the hash function must provide :
if x < i -> x (unchanged)
i -> n+1 (the inserted element)
i+1 .. n -> x+1 (other values, shifted by one)
Then, other elements are either added to the end or position beyond end ( no shift happens) or inserted ( with shift)
I guess this function must be something with modulo, maybe some sequence of addition of modulo ops like (a*x + b) mod k +- (c*x + d) mod m , etc
Like for example, let it be f = (k * x) mod 3 and k = 1 then f(x) = [0, 1,2]
If we insert the new element to the position 1 and change k = 2, f = (2*x) mod 3 the result will be [0,2,1... but no 3 fail here...]
Found what may be a hint : if
a = (x) % 6
b = (x)% 5
c = x // 6
then
for x < 10: a - b - c =5 -> 5 while rest is 0 maybe something like that