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.

A325516 Triangle read by rows: T(n, k) = (1/4)*n*(1 - (-1)^(n - k) + 2*(n - k)^2), with 0 <= k < n.

Original entry on oeis.org

1, 4, 2, 15, 6, 3, 32, 20, 8, 4, 65, 40, 25, 10, 5, 108, 78, 48, 30, 12, 6, 175, 126, 91, 56, 35, 14, 7, 256, 200, 144, 104, 64, 40, 16, 8, 369, 288, 225, 162, 117, 72, 45, 18, 9, 500, 410, 320, 250, 180, 130, 80, 50, 20, 10, 671, 550, 451, 352, 275, 198, 143, 88, 55, 22, 11
Offset: 1

Views

Author

Stefano Spezia, May 07 2019

Keywords

Comments

T(n, k) is the k-superdiagonal sum of the matrix M(n) whose permanent is A322277(n).

Examples

			The triangle T(n, k) begins:
---+------------------------------
n\k|    0     1     2     3     4
---+------------------------------
1  |    1
2  |    4     2
3  |   15     6     3
4  |   32    20     8     4
5  |   65    40    25    10     5
...
For n = 3 the matrix M(3) is
1, 2, 3
6, 5, 4
7, 8, 9
and therefore T(3, 0) = 1 + 5 + 9 = 15, T(3, 1) = 2 + 4 = 6, and T(3, 2) = 3.
		

Crossrefs

Cf. A000027, A317614, A322277, A325517 (row sums).

Programs

  • GAP
    Flat(List([1..11], n->List([0..n-1], k->(1/4)*n*(1 - (-1)^(n - k) + 2*(n - k)^2))));
    
  • Magma
    [[(1/4)*n*(1 - (-1)^(n - k) + 2*(n - k)^2): k in [0..n-1]]: n in [1..11]];
    
  • Maple
    a:=(n, k)->(1/4)*n*(1 - (-1)^(n - k) + 2*(n - k)^2): seq(seq(a(n, k), k=0..n-1), n=1..11);
  • Mathematica
    T[n_,k_] := (1/4) n (1 - (-1)^(n - k) + 2 (n - k)^2); Flatten[Table[T[n, k], {n, 1, 11}, {k, 0, n - 1}]]
  • PARI
    T(n, k) = (1/4)*n*(1 - (-1)^(n - k) + 2*(n - k)^2);
    tabl(nn) = for(n=1, nn, for(k=0, n-1, print1(T(n, k), ", ")); print);
    tabl(11) \\ yields sequence in triangular form

Formula

O.g.f.: x*(1 - 2*y + y^2 + 2*y^3 + x^4*(1 + y^2) + 2*x^3*(1 + y - 3*y^2 + y^3) + 2*x^2*(3 - 5*y - y^2 + y^3) + x*(2 - 2*y - 6*y^2 + 6*y^3))/((1 - x)^4*(1 + x)^2*(1 - y)^3*(1 + y)).
E.g.f.: (1/4)*exp(-x - y)*(x + exp(2*(x + y))*x*(3 + 2*x^2 + x*(6 - 4*y) - 2*y + 2*y^2)).
T(n, k) = n*(n - k)^2/2 if n and k are both even or odd; T(n, k) = n*(n - k)^2/2 + n/2 otherwise.
1st column: T(n, 1) = A317614(n).
Diagonal: T(n, n-1) = n.