OFFSET
1,2
COMMENTS
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.
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.
LINKS
Eric Huang, Tanya Khovanova, Timur Kilybayev, Ryan Li, Brandon Ni, Leone Seidel, Samarth Sharma, Nathan Sheffield, Vivek Varanasi, Alice Yin, Boya Yun, and William Zelevinsky, Card Dealing Math, arXiv:2509.11395 [math.NT], 2025. See p. 17.
EXAMPLE
Triangle begins:
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;
...
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.
PROG
(Python)
from num2words import num2words as n2w
def spell(n):
return sum(1 for c in n2w(n).replace(" and", "").replace(" ", "").replace(chr(44), "").replace("-", ""))
def inverse_permutation(p):
inv = [0] * len(p)
for i, x in enumerate(p):
inv[x-1] = i +1
return inv
def nthRow(n):
l = []
for i in range(0, n):
l.append(0)
zp = 0
for j in range(1, n+1):
zc = 0
while zc <= spell(j):
if l[zp] == 0:
zc += 1
zp += 1
zp = zp % n
l[zp-1] = j
return l
l = []
for i in range(1, 15):
l += inverse_permutation(nthRow(i))
print(l)
(Python)
from num2words import num2words as n2w
def f(n): return sum(1 for c in n2w(n).replace(" and", "") if c.isalpha())
def row(n):
c, i, J = 1, 0, list(range(1, n+1))
out = []
while len(J) > 1:
i = (i + f(c))%len(J)
q = J.pop(i)
out.append(q)
c = c+1
out.append(J[0])
return out
print([e for n in range(1, 15) for e in row(n)]) # Michael S. Branicky, Feb 15 2025
CROSSREFS
KEYWORD
AUTHOR
Tanya Khovanova and the MIT PRIMES STEP junior group, Jan 17 2025
STATUS
approved
