WOLFRAM
|
DEMONSTRATIONS PROJECT
Josephus Problem
n
u
m
b
e
r
o
f
s
o
l
d
i
e
r
s
n
5
m
2
e
x
e
c
u
t
e
t
h
m
s
o
l
d
i
e
r
2
T
h
i
s
D
e
m
o
n
s
t
r
a
t
i
o
n
i
l
l
u
s
t
r
a
t
e
s
t
h
e
c
l
a
s
s
i
c
J
o
s
e
p
h
u
s
p
r
o
b
l
e
m
.
I
n
a
c
i
r
c
l
e
o
f
n
s
o
l
d
i
e
r
s
,
e
v
e
r
y
t
h
m
s
o
l
d
i
e
r
i
s
e
x
e
c
u
t
e
d
.
W
h
i
c
h
s
o
l
d
i
e
r
s
s
u
r
v
i
v
e
?