|
|
A198790
|
|
Irregular table T(n,k) read by rows: Last survivor positions in Josephus problem for n numbers and a count of k, n >= 1, lcm(1, 2, 3, ..., n) >= k >= 1.
|
|
3
|
|
|
1, 2, 1, 3, 3, 2, 2, 1, 1, 4, 1, 1, 2, 2, 3, 2, 3, 3, 4, 4, 1, 5, 3, 4, 1, 2, 4, 4, 1, 2, 4, 5, 3, 2, 5, 1, 3, 4, 1, 1, 3, 4, 1, 2, 5, 4, 2, 3, 5, 1, 3, 3, 5, 1, 3, 4, 2, 1, 4, 5, 2, 3, 5, 5, 2, 3, 5, 1, 4, 3, 1, 2, 4, 5, 2, 2, 4, 5, 2, 3, 1, 6, 5, 1, 5, 1, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Arrange 1, 2, 3, ... n clockwise in a circle. Starting the count at 1, delete every k-th integer clockwise until only one remains, which is T(n,k).
In the full table in A198789, row n repeats with a periodicity of lcm(1, 2, 3, ..., n) = A003418(n). This sequence is a scan of each row in A198789 for exactly one period length.
|
|
LINKS
|
|
|
FORMULA
|
T(1,1) = 1;
for n >= 2, lcm(1, 2, ... n) >= k >=1: T(n,k) = ((T(n-1,((k-1) mod lcm(1, 2, ... n-1)) + 1) + k - 1) mod n) + 1.
|
|
EXAMPLE
|
n\k 1 2 3 4 5 6 7 8 9 10 11 12
---------------------------------------
1 | 1
2 | 2 1
3 | 3 3 2 2 1 1
4 | 4 1 1 2 2 3 2 3 3 4 4 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,tabf
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|