A291317 A variation of the Josephus problem: a(n) is the surviving integer under the following elimination process. Arrange 1,2,3,...,n in a circle, increasing clockwise. Starting with i=1, at k-th stage, move k places clockwise and delete the current number.
1, 1, 1, 3, 4, 3, 7, 7, 6, 10, 7, 12, 3, 10, 11, 7, 11, 1, 12, 6, 21, 1, 7, 12, 25, 3, 25, 28, 16, 26, 25, 6, 32, 19, 15, 21, 28, 3, 12, 21, 24, 13, 21, 36, 17, 45, 41, 45, 8, 40, 11, 6, 25, 41, 23, 4, 43, 52, 51, 57, 28, 21, 11, 47, 26, 29, 57, 51, 48, 56, 12
Offset: 1
Keywords
Examples
The different stages for n=6 are (where ^ indicates the counting reference position): - stage 1: 1^ 2 3 4 5 6 - stage 2: 1 3^ 4 5 6 - stage 3: 1 3 4 6^ - stage 4: 1 3 6^ - stage 5: 3^ 6 - stage 6: 3^ Hence, a(6) = 3.
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..5000
- Rémy Sigrist, Scatterplot of the first 5000 terms of j_A000002 (A000002 = Kolakoski sequence).
- Rémy Sigrist, Scatterplot of the first 5000 terms of j_A020639 (A020639(n) = least prime dividing n).
- Rémy Sigrist, Scatterplot of the first 5000 terms of j_A006519 (A006519(n) = highest power of 2 dividing n).
- Rémy Sigrist, Scatterplot of the first 5000 terms of j_A000120 (A000120(n) = Hamming weight of n).
- Rémy Sigrist, Scatterplot of the first 5000 terms of j_A054868 (A054868(n) = sum of bits of sum of bits of n).
- Index entries for sequences related to the Josephus Problem
Crossrefs
Programs
-
PARI
a(n) = my (l = List(vector(n,i,i)), i = 0); for (k = 1, n-1, i += k; my (p = i \ #l); listpop(l, 1 + (i % #l)); i -= p); return (l[1])
Comments