login
A384774
Elimination order of the first person in a variation of the Josephus problem in which first three people are skipped, then one is eliminated, repeating until all n people are eliminated.
5
1, 2, 1, 2, 5, 3, 2, 5, 9, 8, 3, 12, 6, 10, 4, 16, 12, 16, 5, 9, 20, 10, 6, 22, 21, 23, 7, 27, 13, 21, 8, 30, 23, 20, 9, 16, 31, 17, 10, 31, 24, 35, 11, 34, 20, 27, 12, 28, 34, 49, 13, 23, 31, 24, 14, 49, 55, 34, 15, 35, 27, 59, 16, 44, 38, 60, 17, 30, 53, 31
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
Cf. First column of A384770.
Sequence in context: A124218 A025165 A345278 * A212431 A346517 A318354
KEYWORD
nonn
AUTHOR
Tanya Khovanova, Nathan Sheffield, and the MIT PRIMES STEP junior group, Jun 09 2025
STATUS
approved