OFFSET
1,3
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).
The main diagonal (1, 1, 2, 2, 2, 4, 5, 4, ...) is A007495.
Concatenation of consecutive rows (up to the main diagonal) gives A032434.
The periods of the rows, (1, 2, 6, 12, 60, 60, 420, 840, ...), is given by A003418.
LINKS
FORMULA
T(1,k) = 1; for n > 1: T(n,k) = ((T(n-1,k) + k - 1) mod n) + 1.
EXAMPLE
.n\k 1 2 3 4 5 6 7 8 9 10
----------------------------------
.1 | 1 1 1 1 1 1 1 1 1 1
.2 | 2 1 2 1 2 1 2 1 2 1
.3 | 3 3 2 2 1 1 3 3 2 2
.4 | 4 1 1 2 2 3 2 3 3 4
.5 | 5 3 4 1 2 4 4 1 2 4
.6 | 6 5 1 5 1 4 5 3 5 2
.7 | 7 7 4 2 6 3 5 4 7 5
.8 | 8 1 7 6 3 1 4 4 8 7
.9 | 9 3 1 1 8 7 2 3 8 8
10 | 10 5 4 5 3 3 9 1 7 8
MATHEMATICA
T[n_, k_] := T[n, k] = If[n == 1, 1, Mod[T[n-1, k]+k-1, n]+1];
Table[T[n-k+1, k], {n, 1, 13}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Mar 04 2023 *)
CROSSREFS
KEYWORD
AUTHOR
William Rex Marshall, Nov 21 2011
STATUS
approved