OFFSET
1,3
COMMENTS
A version of the Josephus sieve - see for example A000960. - N. J. A. Sloane, May 26 2007
In this game, all the children start standing in front of a chair and the teacher will chant "eeny-meeny-miny-moe..." and eliminate every eighth player, who then has to sit down. The game continues until only one child remains standing. He or she is declared the winner.
The multiples of 8 never appear in this sequence because they are always wiped out in the first round.
LINKS
FORMULA
For n > 5, if a(n-1) + 8 > n, then a(n) = a(n-1) + 8 - n; otherwise, a(n) = a(n-1) + 8.
EXAMPLE
For n = 4 the winner is the third child because:
1, 2, 3, 4, 1, 2, 3, X (the fourth is eliminated)
1, 2, 3, 1, 2, 3, 1, X (the second is eliminated)
3, 1, 3, 1, 3, 1, 3, X (the first is eliminated, therefore #3 wins); thus a(4)=3.
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Sergio Pimentel, Aug 02 2005
EXTENSIONS
Edited by Charles R Greathouse IV, Nov 11 2009
STATUS
approved