A385513
The numbers of people in the "SpellUnder-Down" variant of the Josephus problem such that the last person is freed.
Original entry on oeis.org
1, 6, 7, 105, 181, 215, 821, 1907, 3176, 23388, 55058
Offset: 1
Suppose there are 5 people in a circle. We start with skipping three people for O-N-E. After three people are skipped, the person number 4 is eliminated. The leftover people are 5,1,2,3 in order. Then we skip three people for T-W-O. The person number 3 eliminated, and the leftover people are 5,1,2 in order. Then we skip 5 people for T-H-R-E-E, and person number 2 is eliminated, and the leftover people are 5,1 in order. Then we skip four people for F-O-U-R. person number 5 is eliminated. Person 1 is freed. As person 1 is not last, 5 is NOT in this sequence.
Cf.
A005589,
A006257,
A182459,
A225381,
A321298,
A378635,
A380201,
A380202,
A380204,
A380246,
A380247,
A380248,
A385328.
A386305
Numbers of people such that the first 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.
Original entry on oeis.org
1, 2, 3, 18, 22, 171, 195, 234, 1262, 2136, 6040, 42545, 353067, 1332099, 1447753, 2789475, 3635021, 7857445, 9224024, 17128159, 27666710, 29279638
Offset: 1
Suppose there are 5 people in a circle. We start with skipping one person and eliminating the next (person number 2). The leftover people are 3,4,5,1 in order. Then we skip two people and eliminate person number 5. The leftover people are 1,3,4 in order. Then we skip three people and person number 1 is eliminated. The leftover people are 3,4 in order. Then we skip four people and eliminate person number 3. Person 4 is freed. As person 1 is not freed, 5 is NOT in this sequence.
-
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) == 1])
Showing 1-2 of 2 results.
Comments