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.

Showing 1-3 of 3 results.

A338456 a(n) is the hafnian of a symmetric Toeplitz matrix M(2n) whose first row consists of a single zero followed by successive positive integers repeated (A004526).

Original entry on oeis.org

1, 1, 4, 45, 968, 34265, 1799748, 131572357, 12770710096, 1589142683313, 246658484353100
Offset: 0

Views

Author

Stefano Spezia, Oct 28 2020

Keywords

Examples

			a(2) = 4 because the hafnian of
0  1  1  2
1  0  1  1
1  1  0  1
2  1  1  0
equals M_{1,2}*M_{3,4} + M_{1,3}*M_{2,4} + M_{1,4}*M_{2,3} = 4.
		

Crossrefs

Cf. A004526.
Cf. A002378 (conjectured determinant of M(2n+1)), A083392 (conjectured determinant of M(n+1)), A332566 (permanent of M(n)), A333119 (k-th super- and subdiagonal sums of the matrix M(n)).

Programs

  • Mathematica
    k[i_]:=Floor[i/2]; M[i_, j_, n_]:=Part[Part[ToeplitzMatrix[Array[k, n]], i], j]; a[n_]:=Sum[Product[M[Part[PermutationList[s, 2n], 2i-1], Part[PermutationList[s, 2n], 2i], 2n], {i, n}], {s, SymmetricGroup[2n]//GroupElements}]/(n!*2^n); Array[a, 5, 0]
  • PARI
    tm(n) = {my(m = matrix(n, n, i, j, if (i==1, j\2, if (j==1, i\2)))); for (i=2, n, for (j=2, n, m[i, j] = m[i-1, j-1]; ); ); m; }
    a(n) = {my(m = tm(2*n), s=0); forperm([1..2*n], p, s += prod(j=1, n, m[p[2*j-1], p[2*j]]);); s/(n!*2^n);} \\ Michel Marcus, Nov 11 2020

Extensions

a(5) from Michel Marcus, Nov 11 2020
a(6)-a(10) from Pontus von Brömssen, Oct 14 2023

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

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 0, 3, 2, 2, 0, 4, 3, 4, 2, 0, 5, 4, 6, 4, 3, 0, 6, 5, 8, 6, 6, 3, 0, 7, 6, 10, 8, 9, 6, 4, 0, 8, 7, 12, 10, 12, 9, 8, 4, 0, 9, 8, 14, 12, 15, 12, 12, 8, 5, 0, 10, 9, 16, 14, 18, 15, 16, 12, 10, 5, 0, 11, 10, 18, 16, 21, 18, 20, 16, 15, 10, 6
Offset: 1

Views

Author

Stefano Spezia, Mar 08 2020

Keywords

Comments

T(n, k) is the k-th super- and subdiagonal sum of the matrix M(n) whose permanent is A332566(n).
The h-th subdiagonal of the triangle T gives 0 followed by the multiples of h+1 repeated.
For k > 0, the (2*k-1)-th and (2*k)-th columns of the triangle T give the multiples of k.

Examples

			n\k| 0 1 2 3 4 5
---+------------
1  | 0
2  | 0 1
3  | 0 2 1
4  | 0 3 2 2
5  | 0 4 3 4 2
6  | 0 5 4 6 4 3
...
For n = 4 the matrix M(4) is
      0 1 1 2
      1 0 1 1
      1 1 0 1
      2 1 1 0
and therefore T(4, 0) = 0, T(4, 1) = 3, T(4, 2) = 2 and T(4, 3) = 2.
		

Crossrefs

Cf. A332566.
Cf. A000004: 1st column; A000027: 2nd and 3rd column; A004526: diagonal; A005843: 4th and 5th column; A052928: 1st subdiagonal; A168237: 2nd subdiagonal; A168273: 3rd subdiagonal; A173196: row sums.

Programs

  • Mathematica
    T[n_,k_]:=(n-k)(1-(-1)^k+2k)/4; Flatten[Table[T[n,k],{n,1,12},{k,0,n-1}]] (* or *)
    r[n_] := Table[SeriesCoefficient[y*(x*(2 + y + y^2) - (1 + y + 2*y^2))/((1 - x)^2 *(1 - y)^3 (1 + y)^2), {x, 0, i}, {y, 0, j}], {i, n, n}, {j, 0, n-1}]; Flatten[Array[r, 12]]

Formula

O.g.f.: y*(x*(2 + y + y^2) - (1 + y + 2*y^2))/((1 - x)^2*(1 - y)^3*(1 + y)^2).
T(n, k) = k*(n - k)/2 for k even.
T(n, k) = (1 + k)*(n - k)/2 for k odd.

A338796 Triangle T read by rows: T(n, k) is the k-th row sum of the symmetric Toeplitz matrix M(n) whose first row consists of a single zero followed by successive positive integers repeated (A004526).

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 4, 3, 3, 4, 6, 5, 4, 5, 6, 9, 7, 6, 6, 7, 9, 12, 10, 8, 8, 8, 10, 12, 16, 13, 11, 10, 10, 11, 13, 16, 20, 17, 14, 13, 12, 13, 14, 17, 20, 25, 21, 18, 16, 15, 15, 16, 18, 21, 25, 30, 26, 22, 20, 18, 18, 18, 20, 22, 26, 30, 36, 31, 27, 24, 22, 21, 21, 22, 24, 27, 31, 36
Offset: 1

Views

Author

Stefano Spezia, Nov 12 2020

Keywords

Examples

			n\k| 1 2 3 4 5 6
---+------------
1  | 0
2  | 1 1
3  | 2 2 2
4  | 4 3 3 4
5  | 6 5 4 5 6
6  | 9 7 6 6 7 9
...
For n = 4 the matrix M(4) is
        0 1 1 2
        1 0 1 1
        1 1 0 1
        2 1 1 0
and therefore T(4, 1) = 4, T(4, 2) = 3, T(4, 3) = 3 and T(4, 4) = 4.
		

Crossrefs

Cf. A004526.
Cf. A002378 (conjectured determinant of M(2n+1)), A083392 (conjectured determinant of M(n+1)), A332566 (permanent of M(n)), A333119 (k-th super- and subdiagonal sums of the matrix M(n)), A338456 (hafnian of M(n)).

Programs

  • Mathematica
    T[n_,k_]:=((-1)^k+(-1)^(n-k+1)+4k^2+4n+2n^2-4k(n+1))/8; Flatten[Table[T[n,k],{n,12},{k,n}]] (* or *)
    r[n_]:=Table[SeriesCoefficient[(2x^3y^2+y^2(1+y)+x^2(y-3y^2)-x(-1+2y+y^2))/((1-x)^3(1+x)(1-y)^3(1+y)),{x,0,i},{y,0,j}],{i,n,n},{j, n}]; Flatten[Array[r,12]] (* or *)
    r[n_]:=Table[SeriesCoefficient[1/8 E^(-x-y)(-1+E^(2 x)+2 E^(2 (x+y))(x (3+x)-2 x y+2 y^2)),{x, 0, i},{y, 0, j}]i!j!,{i, n, n},{j, n}]; Flatten[Array[r, 12]]
  • PARI
    tm(n) = {my(m = matrix(n, n, i, j, if (i==1, j\2, if (j==1, i\2)))); for (i=2, n, for (j=2, n, m[i, j] = m[i-1, j-1]; ); ); m; }
    T(n, k) = my(m = tm(n)); sum(i=1, n, m[i, k]);
    matrix(10, 10, n, k, if (n>=k, T(n,k), 0)) \\ Michel Marcus, Nov 12 2020

Formula

O.g.f.: (2*x^3*y^2 + y^2*(1 + y) + x^2*(y - 3*y^2) - x*(-1 + 2*y + y^2))/((1 - x)^3*(1 + x) *(1 - y)^3*(1 + y)).
E.g.f.: exp(-x-y)*(exp(2*x) + 2*exp(2*(x+y))*(x*(3 + x) - 2*x*y + 2*y^2 - 1))/8.
T(n, k) = ((-1)^k + (-1)^(n-k+1) + 4*k^2 + 4*n + 2*n^2 - 4*k*(n + 1))/8.
T(n, 1) = T(n, n) = A002620(n).
T(n, 2) = A033638(n-1).
T(n, 3) = A290743(n-2).
Sum_{k=1..n} T(n, k) = A212964(n+1).
Showing 1-3 of 3 results.