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.

User: Gordon Atkinson

Gordon Atkinson's wiki page.

Gordon Atkinson has authored 1 sequences.

A325594 Last remaining numbers after a symmetric variation of the Josephus problem.

Original entry on oeis.org

1, 1, 3, 4, 3, 6, 1, 3, 9, 1, 11, 5, 11, 7, 9, 14, 5, 12, 7, 12, 11, 14, 9, 22, 5, 20, 7, 28, 3, 30, 1, 11, 25, 9, 27, 5, 35, 7, 33, 3, 41, 1, 43, 5, 43, 7, 41, 19, 33, 17, 35, 13, 43, 15, 41, 27, 33, 25, 35, 29, 35, 31
Offset: 1

Author

Gordon Atkinson, Sep 07 2019

Keywords

Comments

A variant of the Josephus problem where two numbers are eliminated at every stage, one elimination clockwise, the other counterclockwise. To resolve ambiguities, the usual Josephus problem takes precedence.

Crossrefs

Programs

  • Mathematica
    joseboth[m_, mm_] := Block[{t, p, q, u, v, w}, w = mm - 1; t = Range[m]; p = t; q = t; Do[p = RotateLeft[p, w]; u = First[p]; p = Rest[p]; q = Drop[q, Position[q, u][[1]]]; If[Length[p] == 1, Break[],]; q = RotateRight[q, w]; v = Last[q]; q = Drop[q, -1]; p = Drop[p, Position[p, v][[1]]]; If[Length[q] == 1, Break[],], {n, 1, Ceiling[m/2]}]; p[[1]]];

Formula

A165556(n) = a(n) mod 2.