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 A380247 #26 Feb 23 2025 11:28:05 %S A380247 1,2,1,1,3,2,4,1,3,2,4,3,2,5,1,4,2,5,1,3,6,4,1,2,3,6,5,7,4,8,7,6,1,2, %T A380247 5,3,4,8,6,3,2,1,9,7,5,4,8,5,1,9,6,10,7,2,3,4,8,3,10,6,1,2,7,11,9,5,4, %U A380247 8,2,9,3,10,7,11,12,1,5,6,4,8,1,7,13,6,3,2,12,11,5,9,10,4,8,14,6,12,3,13,10,7,2,11,1,5,9,4 %N A380247 Triangle read by rows: 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 number of people skipped correspond to the number of letters in the next number in English alphabet. %C A380247 In this variation of the Josephus elimination process, the numbers 1 through n are arranged in a circle. A pointer starts at position 1. Then three people are skipped because number O-N-E has three letters, then the next person is eliminated. Next, three people are skipped because T-W-O has three letters, and the next person is eliminated. Then, five people are skipped because T-H-R-E-E has five letters, and so on. This 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 person in the circle. %C A380247 In rows 4 and after, the first number is 4. In rows 8 and after, the second number is 8. In rows 14 and after, the third number is 14. In the limit the numbers form sequence A380202. %e A380247 Triangle begins: %e A380247 1; %e A380247 2, 1; %e A380247 1, 3, 2; %e A380247 4, 1, 3, 2; %e A380247 4, 3, 2, 5, 1; %e A380247 4, 2, 5, 1, 3, 6; %e A380247 4, 1, 2, 3, 6, 5, 7; %e A380247 ... %e A380247 For n = 4 suppose four people are arranged in a circle corresponding to the fourth row of the triangle. Three people are skipped for each letter in O-N-E; then the 4th person is eliminated. This means the row starts with 4. The next three people are skipped, and the person eliminated is number 1. Thus, the next element in the row is 1. Then, 5 people are skipped, and the next person eliminated is number 3. Similarly, the last person eliminated is number 2. Thus, the fourth row of this triangle is 4, 1, 3, 2. %o A380247 (Python) %o A380247 from num2words import num2words as n2w %o A380247 def spell(n): %o A380247 return sum(1 for c in n2w(n).replace(" and", "").replace(" ", "").replace(chr(44), "").replace("-", "")) %o A380247 def inverse_permutation(p): %o A380247 inv = [0] * len(p) %o A380247 for i, x in enumerate(p): %o A380247 inv[x-1] = i +1 %o A380247 return inv %o A380247 def nthRow(n): %o A380247 l = [] %o A380247 for i in range(0,n): %o A380247 l.append(0) %o A380247 zp = 0 %o A380247 for j in range(1,n+1): %o A380247 zc = 0 %o A380247 while zc <= spell(j): %o A380247 if l[zp] == 0: %o A380247 zc += 1 %o A380247 zp += 1 %o A380247 zp = zp % n %o A380247 l[zp-1] = j %o A380247 return l %o A380247 l = [] %o A380247 for i in range(1,15): %o A380247 l += inverse_permutation(nthRow(i)) %o A380247 print(l) %o A380247 (Python) %o A380247 from num2words import num2words as n2w %o A380247 def f(n): return sum(1 for c in n2w(n).replace(" and", "") if c.isalpha()) %o A380247 def row(n): %o A380247 c, i, J = 1, 0, list(range(1, n+1)) %o A380247 out = [] %o A380247 while len(J) > 1: %o A380247 i = (i + f(c))%len(J) %o A380247 q = J.pop(i) %o A380247 out.append(q) %o A380247 c = c+1 %o A380247 out.append(J[0]) %o A380247 return out %o A380247 print([e for n in range(1, 15) for e in row(n)]) # _Michael S. Branicky_, Feb 15 2025 %Y A380247 Cf. A005589, A006257, A225381, A321298, A378635, A380201, A380202, A380204, A380246, A380248. %K A380247 nonn,word,tabl %O A380247 1,2 %A A380247 _Tanya Khovanova_ and the MIT PRIMES STEP junior group, Jan 17 2025