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-10 of 10 results.

A356484 a(n) is the hafnian of a symmetric Toeplitz matrix M(2*n) whose first row consists of prime(2*n), prime(2*n-1), ..., prime(1).

Original entry on oeis.org

1, 2, 44, 5210, 1368900, 604109562, 535920536336, 728155179271474, 1103827431509790216, 2651375713654260218986, 7537958658258053003685636
Offset: 0

Views

Author

Stefano Spezia, Aug 09 2022

Keywords

Comments

a(n) is even for n >= 1. - Robert Israel, Oct 13 2023

Examples

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

Crossrefs

Cf. A356492 (determinant of M(n)), A356493 (permanent of M(n)).

Programs

  • Maple
    haf:= proc(A)
        local n, s, Pairpart, p;
        Pairpart := proc(L) local j, t; if L = {} then return {{}}; end if; {seq(seq({{L[1], L[j]}} union t, t = procname(L minus {L[1], L[j]})), j = 2 .. nops(L))}; end proc;
        n := LinearAlgebra:-Dimension(A);
        if n[1] <> n[2] then
            error "must be square matrix";
        end if;
        n := n[1];
        if n::odd then
            error "dimension of matrix must be even";
        end if;
        add(mul(A[s[1], s[2]], s = p), p = Pairpart({$ (1 .. n)}));
    end proc:
    f:= proc(n) local i; haf(LinearAlgebra:-ToeplitzMatrix([seq(ithprime(i),i=2*n..1,-1)],symmetric)) end proc:
    f(0):= 1:
    map(f, [$0..7]); # Robert Israel, Oct 13 2023
  • Mathematica
    k[i_]:=Prime[i]; M[i_, j_, n_]:=Part[Part[ToeplitzMatrix[Reverse[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, 6, 0]
  • PARI
    tm(n) = my(m = matrix(n, n, i, j, if (i==1, prime(n-j+1), if (j==1, prime(n-i+1))))); 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, May 02 2023

Extensions

a(6) from Michel Marcus, May 02 2023
a(7)-a(9) from Robert Israel, Oct 13 2023
a(10) from Pontus von Brömssen, Oct 14 2023

A356481 a(n) is the hafnian of a symmetric Toeplitz matrix M(2*n) whose first row consists of 1, 2, ..., 2*n.

Original entry on oeis.org

1, 2, 21, 532, 24845, 1856094, 203076097, 30633787976, 6097546660185, 1548899852221210, 489114616743840461
Offset: 0

Views

Author

Stefano Spezia, Aug 09 2022

Keywords

Examples

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

Crossrefs

Cf. A001792 (absolute value of the determinant of M(n)), A204235 (permanent of M(n)).

Programs

  • Mathematica
    k[i_]:=i; 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, 6, 0]
  • PARI
    tm(n) = my(m = matrix(n, n, i, j, if (i==1, j, if (j==1, i)))); 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, May 02 2023

Extensions

a(6) from Michel Marcus, May 02 2023
a(7)-a(10) from Pontus von Brömssen, Oct 14 2023

A356482 a(n) is the hafnian of a symmetric Toeplitz matrix M(2*n) whose first row consists of 2*n, 2*n-1, ..., 1.

Original entry on oeis.org

1, 1, 16, 714, 62528, 9056720, 1960138560, 592615689904, 238560786221056, 123358665203311104, 79683847063011614720
Offset: 0

Views

Author

Stefano Spezia, Aug 09 2022

Keywords

Examples

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

Crossrefs

Cf. A001792 (determinant of M(n)), A307783.

Programs

  • Mathematica
    k[i_]:=i; M[i_, j_, n_]:=Part[Part[ToeplitzMatrix[Reverse[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, 6, 0]
  • PARI
    tm(n) = my(m = matrix(n, n, i, j, if (i==1, n-j+1, if (j==1, n-i+1)))); 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, May 02 2023

Extensions

a(6) from Michel Marcus, May 02 2023
a(7)-a(10) from Pontus von Brömssen, Oct 14 2023

A356490 a(n) is the determinant of a symmetric Toeplitz matrix M(n) whose first row consists of prime(1), prime(2), ..., prime(n).

Original entry on oeis.org

1, 2, -5, 12, -19, -22, 1143, -4284, 14265, -46726, -84405, 1306096, 32312445, 522174906, 4105967871, 5135940112, -642055973735, -2832632334858, 14310549077571, 380891148658140, 4888186898996125, -49513565563840210, 383405170118692791, -2517836083641473036, -3043377347606882055
Offset: 0

Views

Author

Stefano Spezia, Aug 09 2022

Keywords

Comments

Conjecture: abs(a(n)) is prime only for n = 1, 2, and 4.

Examples

			For n = 1 the matrix M(1) is
    2
with determinant a(1) = 2.
For n = 2 the matrix M(2) is
    2, 3
    3, 2
with determinant a(2) = -5.
For n = 3 the matrix M(3) is
    2, 3, 5
    3, 2, 3
    5, 3, 2
with determinant a(3) = 12.
		

Crossrefs

Cf. A005843 (trace of M(n)), A309131 (k-superdiagonal sum of M(n)), A356483 (hafnian of M(2*n)), A356491 (permanent of M(n)).

Programs

  • Maple
    A356490 := proc(n)
        local T,c ;
        if n =0 then
            return 1 ;
        end if;
        T := LinearAlgebra[ToeplitzMatrix]([seq(ithprime(c),c=1..n)],n,symmetric) ;
        LinearAlgebra[Determinant](T) ;
    end proc:
    seq(A356490(n),n=0..15) ; # R. J. Mathar, Jan 31 2023
  • Mathematica
    k[i_]:=Prime[i]; M[ n_]:=ToeplitzMatrix[Array[k, n]]; a[n_]:=Det[M[n]]; Join[{1},Table[a[n],{n,24}]]
  • PARI
    a(n) = matdet(apply(prime, matrix(n,n,i,j,abs(i-j)+1))); \\ Michel Marcus, Aug 12 2022
    
  • Python
    from sympy import Matrix, prime
    def A356490(n): return Matrix(n,n,[prime(abs(i-j)+1) for i in range(n) for j in range(n)]).det() # Chai Wah Wu, Aug 12 2022

Formula

A350955(n) <= a(n) <= A350956(n).

A356491 a(n) is the permanent of a symmetric Toeplitz matrix M(n) whose first row consists of prime(1), prime(2), ..., prime(n).

Original entry on oeis.org

1, 2, 13, 184, 4745, 215442, 14998965, 1522204560, 208682406913, 37467772675962, 8809394996942597, 2597094620811897948, 954601857873086235553, 428809643170145564168434, 229499307540038336275308821, 144367721963876506217872778284, 106064861375232790889279725340713
Offset: 0

Views

Author

Stefano Spezia, Aug 09 2022

Keywords

Comments

Conjecture: a(n) is prime only for n = 1 and 2.

Examples

			For n = 1 the matrix M(1) is
    2
with permanent a(1) = 2.
For n = 2 the matrix M(2) is
    2, 3
    3, 2
with permanent a(2) = 13.
For n = 3 the matrix M(3) is
    2, 3, 5
    3, 2, 3
    5, 3, 2
with permanent a(3) = 184.
		

Crossrefs

Cf. A005843 (trace of the matrix M(n)), A309131 (k-superdiagonal sum of the matrix M(n)), A356483 (hafnian of the matrix M(2*n)), A356490 (determinant of the matrix M(n)).

Programs

  • Maple
    A356491 := proc(n)
        local c ;
        if n =0 then
            return 1 ;
        end if;
        LinearAlgebra[ToeplitzMatrix]([seq(ithprime(c),c=1..n)],n,symmetric) ;
        LinearAlgebra[Permanent](%) ;
    end proc:
    seq(A356491(n),n=0..15) ; # R. J. Mathar, Jan 31 2023
  • Mathematica
    k[i_]:=Prime[i]; M[ n_]:=ToeplitzMatrix[Array[k, n]]; a[n_]:=Permanent[M[n]]; Join[{1},Table[a[n],{n,16}]]
  • PARI
    a(n) = matpermanent(apply(prime, matrix(n,n,i,j,abs(i-j)+1))); \\ Michel Marcus, Aug 12 2022
    
  • Python
    from sympy import Matrix, prime
    def A356491(n): return Matrix(n,n,[prime(abs(i-j)+1) for i in range(n) for j in range(n)]).per() if n else 1 # Chai Wah Wu, Aug 12 2022

Formula

A351021(n) <= a(n) <= A351022(n).

A357279 a(n) is the hafnian of the 2n X 2n symmetric matrix defined by M[i, j] = i + j - 1.

Original entry on oeis.org

1, 2, 43, 2610, 312081, 61825050, 18318396195, 7586241152490, 4184711271725985, 2965919152834367730, 2626408950849351178875
Offset: 0

Views

Author

Stefano Spezia, Sep 25 2022

Keywords

Comments

The n X n matrix M is the n-th principal submatrix of A002024 considered as an array, and it is singular for n > 2.

Examples

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

Crossrefs

Cf. A002024, A002415 (absolute value of the coefficient of x^(n-2) in the characteristic polynomial of M(n)), A095833 (k-th super- and subdiagonal sums of the matrix M(n)), A204248 (permanent of M(n)).

Programs

  • Mathematica
    M[i_, j_, n_]:=Part[Part[Table[r+c-1,{r,n},{c,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, 6, 0]
  • PARI
    tm(n) = matrix(n, n, i, j, i+j-1);
    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, May 02 2023

Extensions

a(6) from Michel Marcus, May 02 2023
a(7)-a(10) from Pontus von Brömssen, Oct 14 2023

A357419 a(n) is the hafnian of the 2n X 2n symmetric Pascal matrix defined by M[i, j] = A007318(i + j - 2, i - 1).

Original entry on oeis.org

1, 1, 17, 4929, 23872137, 1901611778409, 2469317979267366913, 52019468048773355156225921, 17726418489020770628047341494927089, 97518325438289444681986165275143492027985129, 8648473129650550498122567373327602114148485950241817345
Offset: 0

Views

Author

Stefano Spezia, Sep 27 2022

Keywords

Examples

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

Crossrefs

Cf. A007318.
Cf. A006134 (trace of M(n)), A095833 (k-th super- and subdiagonal sums of M(n)), A320845 (permanent of M(n)).

Programs

  • Mathematica
    M[i_, j_, n_]:=Part[Part[Table[Binomial[r+c-2,r-1], {r, n}, {c, 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, 6, 0]

Extensions

a(6)-a(10) from Pontus von Brömssen, Oct 14 2023

A357420 a(n) is the hafnian of the 2n X 2n symmetric matrix defined by M[i,j] = abs(i - j) if min(i, j) < max(i, j) <= 2*min(i, j), and otherwise 0.

Original entry on oeis.org

1, 1, 1, 8, 86, 878, 13730, 348760, 11622396, 509566864, 26894616012, 1701189027944, 125492778658096, 10738546182981256, 1049631636279244832, 117756049412699967072
Offset: 0

Views

Author

Stefano Spezia, Sep 27 2022

Keywords

Examples

			a(4) = 86:
    0,  1,  0,  0,  0,  0,  0,  0;
    1,  0,  1,  2,  0,  0,  0,  0;
    0,  1,  0,  1,  2,  3,  0,  0;
    0,  2,  1,  0,  1,  2,  3,  4;
    0,  0,  2,  1,  0,  1,  2,  3;
    0,  0,  3,  2,  1,  0,  1,  2;
    0,  0,  0,  3,  2,  1,  0,  1;
    0,  0,  0,  4,  3,  2,  1,  0.
		

Crossrefs

Cf. A000982 (number of zero matrix elements of M(n)), A003983, A007590 (number of positive matrix elements of M(n)), A049581, A051125, A352967, A353452 (determinant of M(n)), A353453 (permanent of M(n)).

Programs

  • Mathematica
    M[i_, j_, n_] := If[Min[i, j] < Max[i, j] <= 2 Min[i, j], Abs[j - i], 0]; a[n_] := Sum[Product[M[Part[PermutationList[s, 2 n], 2 i - 1], Part[PermutationList[s, 2 n], 2 i], 2 n], {i, n}], {s, SymmetricGroup[2 n] // GroupElements}]/(n!*2^n); Array[a, 6, 0]

Extensions

a(6)-a(15) from Pontus von Brömssen, Oct 16 2023

A357421 a(n) is the hafnian of the 2n X 2n symmetric matrix whose generic element M[i,j] is equal to the digital root of i*j.

Original entry on oeis.org

1, 2, 54, 1377, 55350, 4164534, 217595322, 11974135554, 999599777190, 150051627647010, 11873389098337236
Offset: 0

Views

Author

Stefano Spezia, Sep 27 2022

Keywords

Examples

			a(3) = 1377:
    1, 2, 3, 4, 5, 6;
    2, 4, 6, 8, 1, 3;
    3, 6, 9, 3, 6, 9;
    4, 8, 3, 7, 2, 6;
    5, 1, 6, 2, 7, 3;
    6, 3, 9, 6, 3, 9.
		

Crossrefs

Cf. A003991, A010888, A353109, A353933 (permanent of M(n)), A353974 (trace of M(n)).

Programs

  • Mathematica
    M[i_, j_, n_] := If[i*j == 0, 0, 1 + Mod[i*j - 1, 9]]; a[n_] := Sum[Product[M[Part[PermutationList[s, 2 n], 2 i - 1], Part[PermutationList[s, 2 n], 2 i], 2 n], {i, n}], {s, SymmetricGroup[2 n] // GroupElements}]/(n!*2^n); Array[a, 6, 0]

Extensions

a(6)-a(10) from Pontus von Brömssen, Oct 15 2023

A381514 a(n) is the hafnian of a symmetric Toeplitz matrix of order 2*n whose off-diagonal element (i,j) equals the |i-j|-th prime.

Original entry on oeis.org

1, 2, 23, 899, 85072, 15120411, 4439935299, 1989537541918, 1264044973158281, 1090056235155152713, 1227540523199054294506
Offset: 0

Views

Author

Stefano Spezia, Feb 25 2025

Keywords

Examples

			a(2) = 23 because the hafnian of
  [d  2  3  5]
  [2  d  2  3]
  [3  2  d  2]
  [5  3  2  d]
equals M_{1,2}*M_{3,4} + M_{1,3}*M_{2,4} + M_{1,4}*M_{2,3} = 2*2 + 3*3 + 5*2 = 23. Here d denotes the generic element on the main diagonal of the matrix from which the hafnian does not depend.
		

Crossrefs

Programs

  • Mathematica
    M[i_, j_]:=Prime[Abs[i-j]]; a[n_]:=Sum[Product[M[Part[PermutationList[s, 2n], 2i-1], Part[PermutationList[s, 2n], 2i]], {i, n}], {s, SymmetricGroup[2n]//GroupElements}]/(n!*2^n); Array[a, 5, 0]

Extensions

a(5)-a(10) from Pontus von Brömssen, Feb 26 2025
Showing 1-10 of 10 results.