Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A128982
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A128982 If in a line of n persons every n-th person is eliminated until only one person is left, which position P should one assume in the original lineup to avoid being eliminated? +0
2
1, 1, 2, 2, 4, 2, 6, 2, 6, 6, 10, 2, 12, 2, 6, 8, 16, 2, 18, 2, 16, 18, 22, 2, 22, 12, 16, 8, 28, 2, 30, 2, 28, 18, 22, 12, 36, 2, 6, 8, 40, 2, 42, 2, 30, 42, 46, 2, 42, 14, 40, 30, 52, 2, 36, 24, 52, 54, 58, 2, 60, 2, 6, 30, 48, 24, 66, 2, 30, 18, 70, 2, 72, 2, 6, 20, 60, 18, 78, 2, 72, 78 (list; graph; listen)
OFFSET

0,3

COMMENT

The difference between this, A007495 and the diagonal of A032434 is that for each of the n-1 elimination processes, counting from 1 to n starts at the lowest position in the line that is still occupied, not right after the most recently eliminated position. Wrapping around when n exceeds the number of residual occupied positions still occurs in circular fashion as in the original Josephus problem. - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), May 07 2007

FORMULA

If n is prime then P = n - 1. If n is prime + 1 then P = 2.

EXAMPLE

Elimination at n=6: 1,2,3,4,5,6 -> 1,2,3,4,5 -> 2,3,4,5 -> 2,4,5 -> 2,4 -> 2. After the 3 is eliminated, counting does not start at 4 but again at 2.

MAPLE

A128982 := proc(n) local l ; l := [seq(i, i=1..n)] ; for i from 1 to n-1 do rm := ((n-1) mod nops(l))+1 ; l := subsop(rm=NULL, l) ; od ; RETURN(op(1, l)) ; end: for n from 1 to 85 do printf("%d, ", A128982(n)) ; od ; - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), May 07 2007

CROSSREFS

Cf. A007495, A032434.

Adjacent sequences: A128979 A128980 A128981 this_sequence A128983 A128984 A128985

Sequence in context: A002322 A127835 A117004 this_sequence A096216 A121599 A080221

KEYWORD

nonn

AUTHOR

Harri Aaltonen (harri.aaltonen(AT)mail.vak.fi), Apr 30 2007

EXTENSIONS

This is a version of the Josephus problem. Several other versions are already in the OEIS. - njas, May 01 2007

Corrected and extended by R. J. Mathar (mathar(AT)strw.leidenuniv.nl), May 07 2007

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified October 7 08:31 EDT 2008. Contains 144667 sequences.


AT&T Labs Research