login
A326296
Triangle of numbers T(n,k) = 2*floor(k/2)*(n-k) + ceiling((k-1)^2/2), 1<=k<=n.
4
0, 0, 1, 0, 3, 2, 0, 5, 4, 5, 0, 7, 6, 9, 8, 0, 9, 8, 13, 12, 13, 0, 11, 10, 17, 16, 19, 18, 0, 13, 12, 21, 20, 25, 24, 25, 0, 15, 14, 25, 24, 31, 30, 33, 32, 0, 17, 16, 29, 28, 37, 36, 41, 40, 41, 0, 19, 18, 33, 32, 43, 42, 49, 48, 51, 50, 0, 21, 20, 37, 36, 49, 48, 57, 56, 61, 60, 61
OFFSET
1,5
COMMENTS
T(n,k) gives the maximum number of inversions in a permutation on n symbols containing a single k-cycle and (n-k) other fixed points.
T(n,n) = A000982(n).
T(n,n-1) = A097063(n).
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1275 (rows 1..50)
FORMULA
T(n,k) = 2*floor(k/2)*(n-k) + ceiling((k-1)^2/2).
T(n,k) = 2*floor(k/2)*(n-k) + binomial(k,2) - ceiling(k/2) + 1.
EXAMPLE
Triangle begins:
0;
0, 1;
0, 3, 2;
0, 5, 4, 5;
0, 7, 6, 9, 8;
0, 9, 8, 13, 12, 13;
0, 11, 10, 17, 16, 19, 18;
0, 13, 12, 21, 20, 25, 24, 25;
0, 15, 14, 25, 24, 31, 30, 33, 32;
0, 17, 16, 29, 28, 37, 36, 41, 40, 41;
0, 19, 18, 33, 32, 43, 42, 49, 48, 51, 50;
0, 21, 20, 37, 36, 49, 48, 57, 56, 61, 60, 61;
...
PROG
(PARI) T(n, k) = {2*floor(k/2)*(n-k) + ceil((k-1)^2/2)} \\ Andrew Howroyd, Sep 10 2019
CROSSREFS
Diagonals give A000982, A097063, A326657, A326658.
Row sums give A000330.
Sequence in context: A092092 A308179 A086800 * A246773 A359843 A364361
KEYWORD
easy,nonn,tabl
AUTHOR
M. Ryan Julian Jr., Sep 10 2019
STATUS
approved