A383076 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-skip-eliminate.
1, 1, 2, 1, 3, 2, 1, 3, 4, 2, 1, 3, 4, 2, 5, 1, 3, 4, 6, 2, 5, 1, 3, 4, 6, 7, 5, 2, 1, 3, 4, 6, 7, 2, 5, 8, 1, 3, 4, 6, 7, 9, 2, 8, 5, 1, 3, 4, 6, 7, 9, 10, 5, 8, 2, 1, 3, 4, 6, 7, 9, 10, 2, 5, 11, 8, 1, 3, 4, 6, 7, 9, 10, 12, 2, 8, 11, 5, 1, 3, 4, 6, 7, 9, 10, 12, 13, 5, 8, 2, 11
Offset: 1
Examples
Consider 4 people in a circle. Initially, person number 1 is eliminated, person number 2 is skipped, and person number 3 is eliminated. The remaining people are now in order 4, 2. Then, 4 is eliminated, and 2 is left. Thus, the fourth row of the triangle is 1, 3, 4, 2, the order of elimination. Triangle begins; 1; 1, 2; 1, 3, 2; 1, 3, 4, 2; 1, 3, 4, 2, 5; 1, 3, 4, 6, 2, 5; 1, 3, 4, 6, 7, 5, 2; 1, 3, 4, 6, 7, 2, 5, 8;
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 + 1)%len(J) if len(J) > 1: out.append(J.pop(i)) out += [J[0]] return out print([e for n in range(1, 14) for e in row(n)]) # Michael S. Branicky, Apr 28 2025
Comments