Problem 1668. Josephus Survivor

The Josephus Challenge is to find the position that is the last remaining when every Kth item is removed from a list of N items. The removal wraps from the end to the start.

Input: N, K where N is the number of players and K is the removal period.

Output: S the last position remaining

Example: N=4 K=2 produces the sequence

1 2 3 4; 1 3 4; 1 3; 1

Comment:

This is a replication of Decimation by James but has a different Historical story reference.

Solution Stats

32.14% Correct | 67.86% Incorrect
Last Solution submitted on Feb 04, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers34

Suggested Problems

More from this Author294

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!