A383845 Triangle T(n,k) read by rows: where T(n,k) is the number of the k-th eliminated person in the variation of the Josephus elimination process for n people, where the elimination pattern is eliminate-eliminate-skip.
1, 1, 2, 1, 2, 3, 1, 2, 4, 3, 1, 2, 4, 5, 3, 1, 2, 4, 5, 3, 6, 1, 2, 4, 5, 7, 3, 6, 1, 2, 4, 5, 7, 8, 6, 3, 1, 2, 4, 5, 7, 8, 3, 6, 9, 1, 2, 4, 5, 7, 8, 10, 3, 9, 6, 1, 2, 4, 5, 7, 8, 10, 11, 6, 9, 3, 1, 2, 4, 5, 7, 8, 10, 11, 3, 6, 12, 9, 1, 2, 4, 5, 7, 8, 10, 11, 13, 3, 9, 12, 6
Offset: 1
Examples
Consider 4 people in a circle. Initially, person number 1 is eliminated, person number 2 is eliminated, and person number 3 is skipped. The remaining people are now in order 4, 3. Then, both are eliminated. Thus, the fourth row of the triangle is 1, 2, 4, 3, the order of elimination. The triangle begins 1; 1, 2; 1, 2, 3; 1, 2, 4, 3; 1, 2, 4, 5, 3; 1, 2, 4, 5, 3, 6; 1, 2, 4, 5, 7, 3, 6; 1, 2, 4, 5, 7, 8, 6, 3;
Crossrefs
Programs
-
Python
def row(n): i, J, out = 0, list(range(1, n+1)), [] while len(J) > 1: i = i%len(J) out.append(J.pop(i)) i = i%len(J) if len(J) > 1: out.append(J.pop(i)) i = (i + 1)%len(J) out += [J[0]] return out print([e for n in range(1, 14) for e in row(n)])
Comments