This is the linear Josephus problem in both directions. This variant has been introduced by the authors, but they have not published it in any mathematical journal.
The Self-Similarity of the Josephus Problems
linearinter[n_, h_] := Block[{p, q, u, rs}, rs = h - 1; elim = {}; elim2 = {}; p = Join[Range[n], Sort[Table[m, {m, 2, n - 1}], Greater]]; q = Reverse[Join[Reverse[Range[n]], Table[k, {k, 2, n - 1}]]]; Do[Do[u1 = First[p]; u2 = First[RotateLeft[p, 1]]; If[u1 == u2, p = RotateLeft[p, 2], p = RotateLeft[p, 1]], {s, 1, rs}]; u = First[p]; p = Rest[p]; elim = Append[elim, u]; If[MemberQ[p, u], p = Delete[p, Position[p, u]],]; If[MemberQ[q, u], q = Delete[q, Position[q, u]],]; If[Length[Union[p]] == 1, Break[],]; Do[u1 = Last[q]; u2 = Last[RotateRight[q, 1]]; If[u1 == u2, q = RotateRight[q, 2], q = RotateRight[q, 1]], {s,1, rs}]; u = Last[q]; q = Drop[q, -1]; elim2 = Append[elim2, u]; If[MemberQ[q, u], q = Delete[q, Position[q, u]],]; If[MemberQ[p, u], p = Delete[p, Position[p, u]],]; If[Length[Union[q]] == 1, Break[],], {t, 1, Ceiling[n/2]}]; p[[1]]];
We are going to prove that the graph of in Example 4.2 has the self-similarity with the ratio of in the next section.
The authors have not proved the existence of the self-similarity for . As to these problems the authors are going to present only graphs, and the graphs seem to have the self-similarity.