cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A165728 If we divide the sequence into these subsequences, the pattern is obvious. {{1,1}, {0,1}, {1,1}}, {{0,1,0,1}, {1,1,1,1}, {0,1,0,1}}, {{1,1,1,1,1,1,1,1}, {0,1,0,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}, {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1}}, ...

This page as a plain text file.
%I A165728 #21 Jun 23 2020 18:24:18
%S A165728 1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,
%T A165728 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,
%U A165728 1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1
%N A165728 If we divide the sequence into these subsequences, the pattern is obvious. {{1,1}, {0,1}, {1,1}}, {{0,1,0,1}, {1,1,1,1}, {0,1,0,1}}, {{1,1,1,1,1,1,1,1}, {0,1,0,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}, {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1}}, ...
%C A165728 This is a sequence made by a variant of the Josephus Problem mod 2, but we use the last number to eliminate instead the last number that remains.
%C A165728 We put n numbers in a circle, and in this variant two numbers are to be eliminated at the same time.
%C A165728 These two processes of elimination go in different directions. Suppose that there are n numbers. Then the first process of elimination starts with the first number and the 2nd, 4th, 6th numbers, ... are to be eliminated.
%C A165728 The second process starts with the n-th number, and the (n-1)-st, (n-3)-rd, (n-5)-th number, ... are to be eliminated.
%C A165728 We suppose that the first process comes first and the second process second at every stage.
%C A165728 We denote by JI2(n) the position of the last number to be eliminated when we have n numbers.
%C A165728 If we use this sequence JI2(n) for n = 6,7,8,... under mod 2, then we get the above sequence with 1 and 0.
%C A165728 Note that we have to omit the first 5 terms to get this sequence with its beautiful pattern.
%H A165728 Hiroshi Matsui, Toshiyuki Yamauchi, Soh Tatsumi, Takahumi Inoue, Masakazu Naito and Ryohei Miyadera, <a href="http://www.kurims.kyoto-u.ac.jp/~kyodo/kokyuroku/contents/pdf/1652-06.pdf">Interesting Variants of the Josephus Problem</a>, Computer Algebra - Design of Algorithms, Implementations and Applications, Kokyuroku, The Research Institute of Mathematical Science, No. 1652, (2009), 44-54.
%H A165728 Masakazu Naito and Ryohei Miyadera, <a href="http://demonstrations.wolfram.com/TheJosephusProblemInBothDirections/">The Josephus Problem in Both Directions</a>, The Wolfram Demonstrations Project.
%H A165728 Masakazu Naito, Daisuke Minematsu and Ryohei Miyadera, <a href="http://www.mi.sanu.ac.rs/vismath/miyadera2009April/JoseVis.html">The Self-Similarity of the Josephus Problem and its Variants</a>, Visual Mathematics, 11(2) (2009).
%H A165728 <a href="/index/J#Josephus">Index entries for sequences related to the Josephus Problem</a>
%F A165728 {JI2(n): n = 1,2,3,4,5,6,7,8} = {1, 2, 1, 1, 1, 3, 5}.
%F A165728 (1) JI2(8*n) = 4*JI2(2*n) - 1 - [JI2(2*n)/(n+1) ].
%F A165728 (2) JI2(8*n+1) = 8*n + 5 - 4*JI2(2*n).
%F A165728 (3) JI2(8*n+2) = 4*JI2(2*n) - 3 - [JI2(2*n)/(n + 2)] .
%F A165728 (4) JI2(8*n+3) = 8*n + 7 - 4*JI2(2*n).
%F A165728 (5) JI2(8*n+4) = 8*n + 8 - 4*JI2(2*n+1) + [JI2(2*n+1)/(n+2)].
%F A165728 (6) JI2(8*n+5) = 4*JI2(2*n+1) - 1.
%F A165728 (7) JI2(8*n+6) = 8*n + 10 - 4*JI2(2*n+1) + [JI2(2*n+1)/(n+2)].
%F A165728 (8) JI2(8*n+7) = 4*JI2(2*n+1) - 3,
%F A165728 Note that recurrence relations are the same as those of A165556, but initial values are different.
%e A165728 Suppose that there are n = 14 numbers. Then the 2nd, 4th, and 6th numbers will be eliminated by the first process. Similarly 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 and 12 and the second process will eliminate 5 and 1. After this the first process will eliminate 3 and 14, and the second process will eliminate 10. The number that remains is 7, and hence the last number to be eliminated is 14. Therefore JI2(14) = 14. JI2(14) = 0 (mod 2).
%t A165728 last2 = {1, 2, 1, 1, 1, 3, 5, 6, 5, 5}; Table[JI2[n] = last2[[n]], {n, 1, 10}]; JI2[m_] := JI2[m] = Block[{n, h}, h = Mod[m, 8]; n = (m - h)/8; Which[h == 0, 4 JI2[2 n] - 1 - Floor[JI2[2 n]/(n + 1)], h == 1, 8 n + 5 - 4 JI2[2 n], h == 2, 4 JI2[2 n] -3 -Floor[JI2[2 n]/(n + 2)], h == 3, 8 n + 7 - 4 JI2[2 n], h == 4, 8 n + 8 - 4 JI2[2 n + 1] + Floor[JI2[2 n + 1]/(n + 2)], h == 5, 4 JI2[2 n + 1] - 1, h == 6, 8 n + 10 - 4 JI2[2 n + 1] + Floor[JI2[2 n + 1]/(n + 2)], h == 7, 4 JI2[2 n + 1] - 3]]; Table[Mod[JI2[n], 2], {n, 6, 95}]
%Y A165728 Cf. A113648, A114144, A165556.
%K A165728 nonn
%O A165728 1,1
%A A165728 _Ryohei Miyadera_ and Masakazu Naito, Sep 25 2009