A165556 A symmetric version of the Josephus problem read modulo 2.
1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
Offset: 1
Keywords
Examples
Suppose that there are n = 14 numbers. Then the 2nd, 4th, and 6th numbers will be eliminated by the first process. Similarly the 13th, 11th, and 9th numbers will be eliminated by the second process. Now two directions are going to overlap. The first process will eliminate the 8, 12 and the second process will eliminate 5, 1. After this the first process will eliminate 3, 14, and the second process will eliminate 10. The number that remains is 7. Therefore JI(14) = 7 and JI(14) = 1 (mod 2).
Links
- Hiroshi Matsui, Toshiyuki Yamauchi, Soh Tatsumi, Takahumi Inoue, Masakazu Naito and Ryohei Miyadera, Interesting Variants of the Josephus Problem, Computer Algebra - Design of Algorithms, Implementations and Applications, Kokyuroku, The Research Institute of Mathematical Science, No. 1652,(2009), 44-54.
- Masakazu Naito and Ryohei Miyadera, The Josephus Problem in Both Directions, The Wolfram Demonstrations Project.
- Masakazu Naito, Sohtaro Doro, Daisuke Minematsu and Ryohei Miyadera, The Self-Similarity of the Josephus Problem and its Variants, Visual Mathematics, 11(2) (2009).
- Index entries for sequences related to the Josephus Problem
Programs
-
Mathematica
initialvalue = {1, 1, 3, 4, 3, 6, 1, 3}; Table[JI[n] = initialvalue[[n]], {n, 1, 8}]; JI[m_] := JI[m] = Block[{n, h}, h = Mod[m, 8]; n = (m - h)/8; Which[h == 0, 4 JI[2 n] - 1 - Floor[JI[2 n]/(n + 1)], h == 1, 8 n + 5 - 4 JI[2 n], h == 2, 4 JI[2 n] -3 -Floor[JI[2 n]/(n + 2)], h == 3, 8 n + 7 - 4 JI[2 n], h == 4, 8 n + 8 - 4 JI[2 n + 1] + Floor[JI[2 n + 1]/(n + 2)], h == 5, 4 JI[2 n + 1] - 1, h == 6, 8 n + 10 - 4 JI[2 n + 1] + Floor[JI[2 n + 1]/(n + 2)], h == 7, 4 JI[2 n + 1] - 3]]; Table[Mod[JI[n], 2], {n, 1, 62}] Flatten[Table[{PadRight[{},2^n,{1}],PadRight[{},2^(n+1),{1,0}]},{n,1,5,2}],1] (* Harvey P. Dale, Mar 24 2013 *)
Formula
a(n) = JI(n) mod 2, and:
JI(8*n) = 4*JI(2*n) - 1 - [JI(2*n)/(n+1)].
JI(8*n+1) = 8*n + 5 - 4*JI(2*n).
JI(8*n+2) = 4*JI(2*n) - 3 - [JI(2*n)/(n+2)].
JI(8*n+3) = 8*n + 7 - 4*JI(2*n).
JI(8*n+4) = 8*n + 8 - 4*JI(2*n+1) + [JI(2*n+1)/(n+2)].
JI(8*n+5) = 4*JI(2*n+1) - 1.
JI(8*n+6) = 8*n + 10 - 4*JI(2*n+1) + [JI(2*n+1)/(n+2)].
JI(8*n+7) = 4*JI(2*n+1) - 3.
where [ ] is the floor function.
Conjecture: a(n) = (1 - (-1)^(n + (n + 1)*floor(log_2(n + 1))))/2. - Velin Yanev, Nov 23 2016
a(n) = A325594(n) mod 2. - Gordon Atkinson, Oct 06 2019
Extensions
New name from Gordon Atkinson, Sep 06 2019 and Oct 04 2019
Comments