A088452 The survivor w(n,4) in a modified Josephus problem, with a step of 4.
1, 1, 1, 3, 2, 6, 5, 1, 3, 10, 7, 9, 1, 2, 6, 5, 17, 18, 11, 13, 15, 10, 2, 1, 11, 10, 7, 9, 17, 30, 31, 31, 19, 22, 22, 27, 26, 23, 18, 1, 1, 1, 6, 19, 17, 18, 17, 13, 15, 14, 30, 29, 53, 50, 55, 55, 50, 33, 34, 38, 38, 39, 49, 47, 46, 46, 41, 29, 31, 1, 2, 6, 1, 1, 3, 10, 34, 34, 34, 30
Offset: 1
Keywords
Links
- Chris Groƫr, The Mathematics of Survival: From Antiquity to the Playground, Amer. Math. Monthly, 110(9) (2003), 812-825.
- Index entries for sequences related to the Josephus Problem
Programs
-
Mathematica
w4[1] = v4[1] = u4[1] = 1; w4[n_] := w4[n] = Switch[ Mod[n, 4], 0, n + 1 - Ceiling[4w4[ Ceiling[3n/4]]/3], 1, n + 1 - Floor[(4w4[ Ceiling[3n/4]] + 1)/3], 2, n + 1 - Floor[4v4[ Ceiling[3n/4]]/3], 3, n + 1 - Floor[(4u4[ Ceiling[3n/4]] - 1)/3]]; v4[n_] := v4[n] = Switch[ Mod[n, 4], 0, n + 1 - Floor[(4w4[ Ceiling[3n/4]] + 1)/3], 1, n + 1 - Floor[(4v4[ Ceiling[3n/4]])/3], 2, n + 1 - Floor[(4u4[ Ceiling[3n/4]] - 1)/3], 3, n + 1 - Ceiling[ 4w4[ Floor[3n/4]]/3]]; u4[n_] := u4[n] = Switch[ Mod[n, 4], 0, n + 1 - Floor[ 4v4[ Ceiling[3n/4]]/3], 1, n + 1 - Floor[ (4u4[ Ceiling[3n/4]] - 1)/3], 2, n + 1 - Ceiling[ 4w4[ Floor[3n/4]]/3], 3, n + 1 - Floor[(4w4[ Floor[3n/4]] + 1)/3]]; Table[ w4[n], {n, 81}] (* from Chris Groer modified by Robert G. Wilson v Nov 15 2003 *)
Extensions
Terms computed by Chris Groer (cgroer(AT)math.uga.edu)