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 12 results. Next

A336400 The hafnian of a symmetric Toeplitz matrix of order 2*n, n>=2 with the first row (0,2,1,...,1,2); a(0)=1, a(1)=2.

Original entry on oeis.org

1, 2, 9, 44, 303, 2697, 29438, 380529, 5683359, 96290588, 1824544857, 38229811083, 877643031554, 21906313145979, 590665804363833, 17109084307014332, 529833078045763263, 17468521692479218209, 610901505126064857854, 22586913755160674065113
Offset: 0

Views

Author

Dmitry Efimov, Jul 22 2020

Keywords

Comments

Number of perfect matchings of a chord diagram with 2*n vertices, where neighboring vertices are joined by two chords, and any other pair of vertices is joined by one chord.

Examples

			A symmetric 4x4 Toeplitz matrix A with the first row (0,2,1,2) has the form:
0 2 1 2
2 0 2 1
1 2 0 2
2 1 2 0.
Its hafnian equals Hf(A)=a12*a34+a13*a24+a14*a23=2*2+1*1+2*2=9.
		

Crossrefs

Programs

  • Magma
    I:=[1,2,9]; [n le 3 select I[n] else ( (22*n^2-118*n+139)*Self(n-1) + (10*n^2-74*n+141)*Self(n-2) + 5*(n-5)*Self(n-3) )/(11*n-40): n in [1..30]]; // G. C. Greubel, Sep 28 2023
    
  • Maple
    a:= proc(n) option remember; `if`(n<3, [1, 2, 9][n+1],
         ((22*n^2-74*n+43)*a(n-1)+(10*n^2-54*n+77)*a(n-2)
          +5*(n-4)*a(n-3))/(11*n-29))
        end:
    seq(a(n), n=0..22);  # Alois P. Heinz, Jul 28 2020
  • Mathematica
    Join[{1,2},Table[2^(n+1)*HypergeometricU[n,1+2 n,2],{n,2,19}]] (* Stefano Spezia, Jul 22 2020 *)
    (* or *) Join[{1, 2}, Table[n*Sum[(n+k-1)!/(k!*(n-k)!*2^(k-1)),{k,0,n}],{n,2,200}]] (* Georg Fischer, Jul 28 2020 *)
  • SageMath
    def A336400(n): return n+1 if n<2 else (2/factorial(n-1))*sum(binomial(n,k)*gamma(n+k)/2^k for k in range(n+1))
    [A336400(n) for n in range(31)] # G. C. Greubel, Sep 28 2023

Formula

a(n) = n*Sum_{k=0..n} (n+k-1)!/(k!*(n-k)!*2^(k-1)), n>=2.
a(n) = A001515(n) + A001515(n-1), n>=2.
a(n) ~ (2*n)!*e/(n!*2^n).
a(n) = 2^(n+1)*U(n, 1+2*n, 2) for n >= 2, where U(a, b, c) is the confluent hypergeometric function. - Stefano Spezia, Jul 22 2020
a(n) = ((22*n^2-74*n+43)*a(n-1) + (10*n^2-54*n+77)*a(n-2) + 5*(n-4)*a(n-3)) / (11*n-29) for n >= 3. - Alois P. Heinz, Jul 28 2020
E.g.f.: - 1 - x + (1 + 1/sqrt(1-2*x))*exp(1 - sqrt(1-2* x)). - G. C. Greubel, Sep 28 2023

Extensions

Incorrect recurrences removed and a(18) corrected by Georg Fischer, Jul 28 2020

A336286 The hafnian of a symmetric Toeplitz matrix of order 2*n, n>=2 with the first row (0,1,2,...,2,0); a(0)=a(1)=1.

Original entry on oeis.org

1, 1, 5, 57, 859, 16087, 362781, 9593105, 291347603, 9998539791, 382732896853, 16169762600329, 747423640472235, 37523173542935207, 2033249827596197549, 118278700627740322977, 7352204062275501662371, 486343759162888783503775, 34112193002666850227154213
Offset: 0

Views

Author

Dmitry Efimov, Jul 16 2020

Keywords

Comments

Number of perfect matchings of an arc diagram with 2*n vertices, where neighboring vertices are joined by one arc, the vertices 1 and 2*n are not adjacent if n>=2, and all other pairs of vertices are joined by two arcs.

Examples

			A symmetric 4 X 4 Toeplitz matrix A with the first row (0,1,2,0) has the form:
  0 1 2 0
  1 0 1 2
  2 1 0 1
  0 2 1 0.
Its hafnian equals Hf(A) = a12*a34 + a13*a24 + a14*a23 = 1*1 + 2*2 + 0*1 = 5 = a(2).
		

Crossrefs

Programs

  • Maple
    [1,1,seq(add((-1)^(n-k-1)*(n+k-1)!*(-3*n+k)/(k!*(n-k)!),k=0..n),n=2..32)] # Georg Fischer, Jun 05 2021
  • Mathematica
    Join[{1,1},RecurrenceTable[{a[n+1] == (4*n+4)*a[n]-(8*n-13)*a[n-1]-2*a[n-2], a[2]==5, a[3]==57, a[4]==859}, a[n], {n,2,32}]] (* Georg Fischer, Jun 05 2021 *)

Formula

a(n) = Sum_{k=0..n} (-1)^(n-k)*(n+k-1)!*(3*n-k)/(k!*(n-k)!), n>=2.
D-finite with recurrence a(n+1) = (4n+4)*a(n) - (8n-13)*a(n-1) - 2*a(n-2), n>=4.
D-finite with recurrence a(n+1) = ((32*n^2-12*n+2)*a(n) + (8*n+1)*a(n-1))/(8*n-7), n>=3.
a(n) = |A002119(n)| - 2*|A002119(n-1)|, n>=2.
a(n) ~ (2*n)!/sqrt(e)*n!.

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

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

Original entry on oeis.org

1, 3, 55, 2999, 347391, 69702479, 22441691645, 10776262328919, 7190279422736061, 6439969796874334809, 7447188585071730451961
Offset: 0

Views

Author

Stefano Spezia, Aug 09 2022

Keywords

Examples

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

Crossrefs

Cf. A356490 (determinant of M(n)), A356491 (permanent of M(n)).

Programs

  • Mathematica
    k[i_]:=Prime[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, prime(j), if (j==1, prime(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

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

A098985 Denominators in series expansion of log( Sum_{m=-oo,oo} q^(m^2) ).

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 5, 1, 17, 9, 19, 5, 21, 11, 23, 3, 25, 13, 27, 7, 29, 5, 31, 1, 11, 17, 35, 9, 37, 19, 39, 5, 41, 21, 43, 11, 15, 23, 47, 3, 49, 25, 17, 13, 53, 27, 55, 7, 57, 29, 59, 5, 61, 31, 63, 1, 65, 11, 67, 17, 23, 35, 71, 9, 73, 37, 75, 19, 77, 39, 79
Offset: 0

Views

Author

N. J. A. Sloane, Oct 24 2004

Keywords

Comments

For n>0, a(n) is the denominator of Sum_{odd d|n} 1/d. See Sumit Kumar Jha link. - Michel Marcus, Jul 21 2020

Examples

			2*q-2*q^2+8/3*q^3-2*q^4+12/5*q^5-8/3*q^6+16/7*q^7-2*q^8+26/9*q^9-...
		

Crossrefs

Cf. A336113 (numerators).

Programs

  • Maple
    A098985_list := proc(n::integer)
        local q,m,nsq ;
        nsq := floor(sqrt(n)) ;
        add(q^(m^2),m=-nsq-1..nsq+1) ;
        log(%) ;
        taylor(%,q=0,n+1) ;
        [seq( denom(coeftayl(%,q=0,i)) ,i=1..n) ] ;
    end proc:
    A098985_list(200) ; # R. J. Mathar, Jul 16 2020
    A336114 := proc(n::integer)
        local a ;
        for d in numtheory[divisors](n) do
            if type(d,'odd') then
                a := a+1/d ;
            end if;
        end do;
        denom(a) ;
    end proc:
    seq(A336114(n),n=1..70) ; # R. J. Mathar, Jul 16 2020
  • Mathematica
    Denominator[CoefficientList[Series[Log[Sum[q^m^2, {m, -Infinity, Infinity}]], {q, 0, 79}], q]] (* L. Edson Jeffery, Jul 14 2014 *)
    a[n_] := Denominator @ DivisorSum[n, 1/# &, OddQ[#] &]; Array[a, 100] (* Amiram Eldar, Jul 09 2020 *)
  • PARI
    lista(nn) = {my(k = sqrtint(nn), s = sum(m=-k-1, k+1, x^(m^2)) + O(x^nn)); apply(x->denominator(x), Vec(log(s)));} \\ Michel Marcus, Jul 17 2020
    
  • PARI
    a(n) = if (n==0, 1, denominator(sumdiv(n, d, if (d%2, 1/d)))); \\ Michel Marcus, Jul 21 2020; corrected Jun 13 2022

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
Showing 1-10 of 12 results. Next