cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A326296 Triangle of numbers T(n,k) = 2*floor(k/2)*(n-k) + ceiling((k-1)^2/2), 1<=k<=n.

Original entry on oeis.org

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

Views

Author

M. Ryan Julian Jr., Sep 10 2019

Keywords

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).

Examples

			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;
...
		

Crossrefs

Diagonals give A000982, A097063, A326657, A326658.
Row sums give A000330.

Programs

  • PARI
    T(n,k) = {2*floor(k/2)*(n-k) + ceil((k-1)^2/2)} \\ Andrew Howroyd, Sep 10 2019

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.