OFFSET
1,2
COMMENTS
The numbers 1 through n are arranged in a circle. The process starts at position 1. Initially, the first number is skipped, and the next number is eliminated. Then, two numbers are skipped, and the next one is eliminated. Then, three numbers are skipped, and so on. The process repeats until no numbers remain.
This variation of the Josephus problem can equivalently be described in terms of the AP card dealing, where the cards of a deck are dealt by alternately x cards from the top "under", and then dealing the next card "down". Here, x starts as 1, and is increased by 1 with every dealt card. In particular, T(n,k) is the k-th card dealt in the AP dealing if the deck begins in order 1,2,3,...,n.
The freed person is A291317(n).
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 pp. 17, 39.
EXAMPLE
Consider 4 people in a circle. Initially, person number 1 is skipped, and person 2 is eliminated. The remaining people are now in order 3, 4, 1. Then, two people are skipped, and person 1 is eliminated. The remaining people are in order 3, 4. Now, three people are skipped and person 4 is eliminated. Person 3 is eliminated last. Thus, the fourth row of the triangle is 2,1,4,3.
The triangle begins as follows:
1;
2, 1;
2, 3, 1;
2, 1, 4, 3;
2, 5, 1, 3, 4;
2, 5, 4, 1, 6, 3;
2, 5, 3, 4, 1, 6, 7;
2, 5, 1, 8, 4, 6, 3, 7;
2, 5, 9, 7, 8, 4, 1, 3, 6;
PROG
(Python)
def row(n):
c, i, J = 1, 0, list(range(1, n+1))
output = []
while len(J) > 1:
i = (i + c) % len(J)
q = J.pop(i)
output.append(q)
c = c + 1
output.append(J[0])
return output
print([e for n in range(1, 15) for e in row(n)])
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Tanya Khovanova, Nathan Sheffield, and the MIT PRIMES STEP junior group, Jul 27 2025
STATUS
approved
