A178853 "Josephus problem": n persons stand in a circle and eliminate every seventh person counting clockwise until only person a(n) is remaining.
1, 2, 3, 2, 4, 5, 5, 4, 2, 9, 5, 12, 6, 13, 5, 12, 2, 9, 16, 3, 10, 17, 1, 8, 15, 22, 2, 9, 16, 23, 30, 5, 12, 19, 26, 33, 3, 10, 17, 24, 31, 38, 2, 9, 16, 23, 30, 37, 44, 1, 8, 15, 22, 29, 36, 43, 50, 57, 5, 12, 19, 26, 33, 40, 47, 54, 61, 68, 6, 13, 20, 27, 34, 41, 48, 55, 62, 69, 76
Offset: 1
Keywords
Links
- Leonhard Euler, Observationes circa novum et singulare progressionum genus. In: Novi Comment. Akadem. Petropol. Vol.20 (1775).
- Eric Weisstein's World of Mathematics, Josephus Problem.
- Index entries for sequences related to the Josephus Problem.
Programs
-
Mathematica
Needs["Combinatorica`"] a[n_] := Last@ InversePermutation@ Josephus[n, 7]; Array[a, 79] (* Robert G. Wilson v, Jul 31 2010 *)
Extensions
a(29) onwards from Robert G. Wilson v, Jul 31 2010
Comments