login
A386312
Numbers of people such that the last person is freed in the variant of the Josephus problem in which one person is skipped, then one is eliminated, then two people are skipped and one eliminated, then three people are skipped and so on.
1
1, 7, 10, 12, 21, 25, 28, 235, 822, 24886, 99607, 101497, 107716, 5756103, 55480598
OFFSET
1,2
COMMENTS
This sequence can also be described in terms of "AP dealing", in which one deals a deck of N cards into a new deck by moving one card to the bottom, dealing out the next card on top of the new deck, moving two cards to the bottom, etc. This sequence consists of all the deck sizes such that the bottom card of the deck moves to the top after AP dealing.
Numbers k such that A291317(k) = k.
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. 18.
EXAMPLE
Suppose there are people 1,2,3,4,5,6,7 in a circle. We first skip one person and eliminate the next, leaving people in order 3,4,5,6,7,1. Now, we skip two people and eliminate the next, leaving 6,7,1,3,4. Now, we skip three and eliminate the next, leaving 4,6,7,1. Now, we skip four and eliminate the next, leaving 6,7,1. Now, we skip five and eliminate the next, leaving 6,7. Finally, we skip six and eliminate the next, leaving just 7. As the last person in the circle was freed, 7 belongs to this sequence.
PROG
(Python)
def F(n):
c, i, J = 1, 0, list(range(1, n+1))
while len(J) > 1:
i = (i + c) % len(J)
q = J.pop(i)
c = c + 1
return J[0]
print([n for n in range(1, 100000) if F(n) == n])
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Tanya Khovanova, Nathan Sheffield, and the MIT PRIMES STEP junior group, Aug 20 2025
EXTENSIONS
a(15) from Jinyuan Wang, Aug 31 2025
STATUS
approved