josephus problems (replace null)