This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A383076 #10 May 04 2025 17:29:11 %S A383076 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, %T A383076 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, %U A383076 3,4,6,7,9,10,12,2,8,11,5,1,3,4,6,7,9,10,12,13,5,8,2,11 %N 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. %C A383076 This Josephus problem is related to down-under-down card dealing. %C A383076 The n-th row has n elements. %C A383076 In this variation of the Josephus elimination process, the numbers 1 through n are arranged in a circle. A pointer starts at position 1. With each turn, the pointer eliminates the first number, skips the second, then eliminates the third. The process repeats until no numbers remain. This sequence represents the triangle T(n, k), where n is the number of people in the circle, and T(n, k) is the elimination order of the k-th number in the circle. %e A383076 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. %e A383076 Triangle begins; %e A383076 1; %e A383076 1, 2; %e A383076 1, 3, 2; %e A383076 1, 3, 4, 2; %e A383076 1, 3, 4, 2, 5; %e A383076 1, 3, 4, 6, 2, 5; %e A383076 1, 3, 4, 6, 7, 5, 2; %e A383076 1, 3, 4, 6, 7, 2, 5, 8; %o A383076 (Python) %o A383076 def row(n): %o A383076 i, J, out = 0, list(range(1, n+1)), [] %o A383076 while len(J) > 1: %o A383076 i = i%len(J) %o A383076 out.append(J.pop(i)) %o A383076 i = (i + 1)%len(J) %o A383076 if len(J) > 1: %o A383076 out.append(J.pop(i)) %o A383076 out += [J[0]] %o A383076 return out %o A383076 print([e for n in range(1, 14) for e in row(n)]) # _Michael S. Branicky_, Apr 28 2025 %Y A383076 Cf. A006257, A032766, A225381, A321298, A378635, A381050, A381051. %K A383076 nonn,tabl %O A383076 1,3 %A A383076 _Tanya Khovanova_, _Nathan Sheffield_, and the MIT PRIMES STEP junior group, Apr 15 2025