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 A380204 #20 Jul 23 2025 08:45:46 %S A380204 1,1,2,2,1,6,7,3,5,3,5,6,10,9,2,13,3,16,10,2,15,6,15,6,21,1,7,23,26,6, %T A380204 20,12,27,29,7,2,36,11,6,7,32,6,32,43,10,31,7,5,42,1,17,48,7,31,53,25, %U A380204 42,43,29,39,51,25,43,7,26,59,15,10,60,69,13,57,54,66,57,30,9,35,64,9,65,1,15,3,79,47,86,7 %N A380204 A version of the Josephus problem: a(n) is the surviving integer under the spelling version of the elimination process. %C A380204 Arrange n people numbered 1, 2, 3, ..., n in a circle, increasing clockwise. Starting with the person numbered 1, spell the letters of O-N-E, moving one person clockwise for each letter. Once you are done, eliminate the next person. Then, spell the letters of T-W-O; in other words, skip three people and eliminate the next person. Following this, spell the letters of T-H-R-E-E; in other words, skip five people and eliminate the next person. Continue until one person remains. The number of this person is a(n). %H A380204 Michael S. Branicky, <a href="/A380204/b380204.txt">Table of n, a(n) for n = 1..20000</a> %e A380204 Consider n = 4 people. The first person eliminated is number 4. This leaves the remaining people in the order 1, 2, 3. The second person eliminated is number 1; the people left are in the order 2, 3. The next person eliminated is numbered 3, leaving only the person numbered 2. Thus a(4) = 2. %o A380204 (Python) %o A380204 from num2words import num2words as n2w %o A380204 def f(n): return sum(1 for c in n2w(n).replace(" and", "") if c.isalpha()) %o A380204 def a(n): %o A380204 c, i, J = 1, 0, list(range(1, n+1)) %o A380204 while len(J) > 1: %o A380204 i = (i + f(c))%len(J) %o A380204 q = J.pop(i) %o A380204 c = c+1 %o A380204 return J[0] %o A380204 print([a(n) for n in range(1, 89)]) # _Michael S. Branicky_, Jan 26 2025 %Y A380204 Cf. A005589, A006257, A225381, A321298, A378635, A380201, A380202, A380246, A380247, A380248. %K A380204 nonn,word %O A380204 1,3 %A A380204 _Tanya Khovanova_ and the MIT PRIMES STEP junior group, Jan 16 2025 %E A380204 Terms a(22) and beyond corrected by _Michael S. Branicky_, Feb 15 2025