OFFSET
1,2
COMMENTS
This sequence is a permutation of the positive integers. - Werner Schulte, Jul 29 2023
FORMULA
From Werner Schulte, Jul 29 2023: (Start)
T(n, k) = n*(n+1)/2 + floor(n/2) - 2*(k-1) for 1 <= k <= n.
T(n, n) = (n^2-3*n+4)/2 + floor(n/2) for n > 0.
T(2*n-1, n) = n^2 + (n-1)^2 = A001844(n-1) for n > 0. (End)
EXAMPLE
1;
4, 2;
7, 5, 3;
12, 10, 8, 6;
17, 15, 13, 11, 9;
24, 22, 20, 18, 16, 14;
31, 29, 27, 25, 23, 21, 19;
40, 38, 36, 34, 32, 30, 28, 26;
PROG
(PARI) T(n, k)=n*(n+1)/2+floor(n/2)-2*(k-1) \\ Werner Schulte, Jul 29 2023
CROSSREFS
KEYWORD
AUTHOR
Amarnath Murthy, Jul 08 2005
EXTENSIONS
More terms from Joshua Zucker, May 05 2006
STATUS
approved