OFFSET
1,3
COMMENTS
a(3k-1) = 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. 17.
EXAMPLE
Consider n = 4 people. The first person eliminated is number 3. This leaves the remaining people in order 4, 1, 2. The second person eliminated is number 2. Thus, the remaining people in order 4, 1. The next person eliminated is number 4. On the fourth step, person number 1 is eliminated, implying that the order of elimination of the first person is 4: a(4) = 4.
PROG
(Python)
def UUD(n):
return invPerm(UUDES(n))
def UUDES(n):
l=[]
for i in range(n):
l.append(i+1)
index = 0
P=[]
for i in range(n):
index+=2
index=index%len(l)
P.append(l[index])
l.pop(index)
return P
def invPerm(p):
inv = []
for i in range(len(p)):
inv.append(None)
for i in range(len(p)):
inv[p[i]-1]=i+1
return inv
sequence = []
for i in range(1, 71):
sequence += [str(UUD(i)[0])]
print(", ".join(sequence))
(Python)
def a(n):
c, i, J = 1, 0, list(range(1, n+1))
while len(J) > 0:
i = (i + 2)%len(J)
q = J.pop(i)
if q == 1: return c
c = c+1
print([a(n) for n in range(1, 71)]) # Michael S. Branicky, Mar 24 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Tanya Khovanova, Nathan Sheffield, and the MIT PRIMES STEP junior group, Mar 02 2025
STATUS
approved
