OFFSET
1,2
COMMENTS
a(4k-1) = k
a(n) = A384770(n,1).
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 4. This leaves the remaining people in order 1, 2, 3. On the second step, we eliminate person number 1, implying that the order of elimination of the first person is 2: a(4) = 2.
MAPLE
A384774 := proc(n::integer)
local plist, eli, skip, ptr ;
plist := [seq(i, i=1..n)] ;
eli :=1 ;
skip := 3;
ptr := 0 ;
while true do
ptr := modp(ptr+skip, nops(plist)) ;
if op(ptr+1, plist) = 1 then
return eli ;
end if;
plist := subsop(ptr+1=NULL, plist) ;
eli := eli+1 ;
end do:
end proc:
seq(A384774(n), n=1..100) ; # R. J. Mathar, Jul 30 2025
PROG
(Python)
def a(n):
c, i, J = 1, 0, list(range(1, n+1))
while len(J) > 0:
i = (i + 3)%len(J)
q = J.pop(i)
if q == 1: return c
c = c+1
print([a(n) for n in range(1, 71)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Tanya Khovanova, Nathan Sheffield, and the MIT PRIMES STEP junior group, Jun 09 2025
STATUS
approved
