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

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

A012259 Expansion of e.g.f. exp(arctanh(tan(x))).

Original entry on oeis.org

1, 1, 1, 5, 17, 121, 721, 6845, 58337, 698161, 7734241, 111973685, 1526099057, 25947503401, 419784870961, 8200346492525, 153563504618177, 3389281372287841, 72104198836466881, 1774459993676715365, 42270463533824671697, 1147649139272698443481
Offset: 0

Views

Author

Patrick Demichel (patrick.demichel(AT)hp.com)

Keywords

Examples

			 exp(arctanh(tan(x))) = 1 + x + x^2/2! + 5*x^3/3! + 17*x^4/4! + 121*x^5/5! + ...
		

Crossrefs

Cf. A012077, A012085, A185411, A202038 (signed version).

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!( Sqrt((1+Tan(x))/(1-Tan(x))) )); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Jun 06 2019
    
  • Mathematica
    With[{nn=30}, CoefficientList[Series[Sqrt[(1+Tan[x])/(1-Tan[x])], {x, 0, nn}], x]*Range[0,nn]!] (* Vaclav Kotesovec, Oct 23 2013 *)
  • PARI
    {a(n)=local(A=1); for(i=0, n, A = exp( intformal( (A^2 + subst(A^2, x, -x))/2 +x*O(x^n)) )); n!*polcoeff(A, n)}
    for(n=0, 25, print1(a(n), ", ")) \\ Paul D. Hanna, Feb 04 2017
    
  • PARI
    my(x='x+O('x^30)); Vec(serlaplace( sqrt((1+tan(x))/(1-tan(x))) )) \\ G. C. Greubel, Jun 06 2019
    
  • Sage
    m = 30; T = taylor(sqrt((1+tan(x))/(1-tan(x))), x, 0, m); [factorial(n)*T.coefficient(x, n) for n in (0..m)] # G. C. Greubel, Jun 06 2019

Formula

Alternative form of e.g.f: sqrt(sec(2*x) + tan(2*x)) = 1 + x + x^2/2! + 5*x^3/3! + 17*x^4/4! + ... (where sec(x)=1/cos(x)). - Peter Bala, Jan 11 2011
a(n) = 2^n*Z(n,1/2), where Z(n,x) is the n-th zigzag polynomial as defined in A147309.
Put y = x*log(x)/4. The connection between the expansion sqrt(2/(1+x^x)) = 1 - y - y^2/2! + 5*y^3/3! + 17*y^4/4! - 121*y^5/5! ... and the present sequence is explained in the answer to Mathematics Stack Exchange Question 6939. - Peter Bala, Jul 10 2011
exp(arctanh(tan(x))) = sqrt( (1 + tan(x))/(1 - tan(x) ) ) = sqrt( tan(x+pi/4) ). - David Callan, Dec 13 2011
a(n) ~ 2^(2*n+3/2) * n^n / (Pi^(n+1/2) * exp(n)). - Vaclav Kotesovec, Oct 23 2013
E.g.f. A(x) satisfies: A(x) = exp( Integral (A(x)^2 + A(-x)^2)/2 dx ). - Paul D. Hanna, Feb 04 2017
E.g.f. A(x) satisfies: A'(x) = A(x) * (A(x)^2 + A(-x)^2)/2. - Paul D. Hanna, Feb 04 2017

A185410 A decomposition of the double factorials A001147.

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 1, 10, 4, 0, 1, 36, 60, 8, 0, 1, 116, 516, 296, 16, 0, 1, 358, 3508, 5168, 1328, 32, 0, 1, 1086, 21120, 64240, 42960, 5664, 64, 0, 1, 3272, 118632, 660880, 900560, 320064, 23488, 128, 0, 1, 9832, 638968, 6049744, 14713840, 10725184, 2225728, 95872, 256, 0
Offset: 0

Views

Author

Paul Barry, Jan 26 2011

Keywords

Comments

Row sums are A001147. Reversal of A185411.
From Peter Bala, Jul 24 2012: (Start)
This is the case k = 2 of the 1/k—Eulerian polynomials introduced by Savage and Viswanathan. They give a combinatorial interpretation of the triangle in terms of an ascent statistic on sets of inversion sequences and a geometric interpretation in terms of lecture hall polytopes.
Row reverse of A156919.
(End)
Triangle T(n,k), 0<=k<=n, given by (1, 0, 3, 0, 5, 0, 7, 0, 9, 0, ...) DELTA (0, 2, 0, 4, 0, 6, 0, 8, 0, 10, 0, ...) where DELTA is the operator defined in A084938. - Philippe Deléham, Feb 12 2013

Examples

			Triangle begins:
  1,
  1,    0,
  1,    2,      0,
  1,   10,      4,       0,
  1,   36,     60,       8,        0,
  1,  116,    516,     296,       16,        0,
  1,  358,   3508,    5168,     1328,       32,       0,
  1, 1086,  21120,   64240,    42960,     5664,      64,     0,
  1, 3272, 118632,  660880,   900560,   320064,   23488,   128,   0,
  1, 9832, 638968, 6049744, 14713840, 10725184, 2225728, 95872, 256, 0,
  ...
In the Savage-Viswanathan paper, the coefficients appear as
  1
  1    2
  1   10     4
  1   36    60     8
  1  116   516   296    16
  1  358  3508  5168  1328   32
  1 1086 21120 64240 42960 5664 64
  ...
		

Crossrefs

Cf. A156919, A001147 (row sums), A112857, A173018, A186695, A202038 (alt. row sums).

Programs

  • Mathematica
    T[0, 0] := 1;  T[n_, -1] := 0;  T[n_, n_] := 0; T[n_, k_] := T[n, k] = (n - k)*T[n - 1, k - 1] + (2*k + 1)*T[n - 1, k]; Join[{1}, Table[If[k < 0, 0, If[k >= n, 0, 2^k*T[n, k]]], {n, 1, 5}, {k, 0, n}] // Flatten] (* G. C. Greubel, Jun 30 2017 *)

Formula

G.f.: 1/(1-x/(1-2xy/(1-3x/(1-4xy/(1-5x/(1-6xy/(1-7x/(1-8xy/(1- .... (continued fraction).
From Peter Bala, Jul 24 2012: (Start)
T(n,k) = sum {j=0..k}(-1)^(k-j)/4^j*C(n+1/2,k-j)*C(2*j,j)*(2*j+1)^n.
Recurrence equation: T(n+1,k) = (2*k+1)*T(n,k) + 2*(n-k+1)*T(n,k-1).
E.g.f.: sqrt(E(x,2*z)) = 1 + z + (1+2*x)*z^2/2! + (1+10*x+4*x^2)*z^3/3! + ..., where E(x,z) = (1-x)/(exp(z*(x-1)) - x) is the e.g.f. for the Eulerian numbers (version A173018). Cf. A156919.
Row polynomial R(n,x) = sum {k = 1..n} 2^(n-2*k)*C(2*k,k)*k!*Stirling2(n,k)*(x-1)^(n-k). R(n,4*x)/(1-4*x)^(n+1/2) = sum {k>=0} C(2*k,k)*(2*k+1)^n*x^k. The sequence of rational functions x*R(n,x)/(1-x)^(n+1) conjecturally occurs in the first column of (I - x*A112857)^(-1). (1+x)^(n-1)*R(n,x/(x+1)) gives the n-th row polynomial of A186695.
Row sums A001147. Alt. row sums A202038. (End)
T(n,k) = 2^k*A102365(n,k). - Philippe Deléham, Feb 12 2013

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

A291207 Square array A(n,k), n >= 0, k >= 0, read by antidiagonals, where column k is the expansion of continued fraction 1/(1 + x/(1 - 2^k*x/(1 + 3^k*x/(1 - 4^k*x/(1 + 5^k*x/(1 - ...)))))).

Original entry on oeis.org

1, 1, -1, 1, -1, 0, 1, -1, -1, 1, 1, -1, -3, 5, 0, 1, -1, -7, 27, 17, -2, 1, -1, -15, 167, 441, -121, 0, 1, -1, -31, 1071, 10673, -11529, -721, 5, 1, -1, -63, 6815, 262305, -1337713, -442827, 6845, 0, 1, -1, -127, 42687, 6525377, -161721441, -297209047, 23444883, 58337, -14
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 21 2017

Keywords

Examples

			G.f. of column k: A_k(x) = 1 - x + (1 - 2^k)*x^2 + (2^(k + 1) - 4^k + 6^k - 1)*x^3 + ...
Square array begins:
   1,     1,       1,         1,           1,             1,  ...
  -1,    -1,      -1,        -1,          -1,            -1,  ...
   0,    -1,      -3,        -7,         -15,           -31,  ...
   1,     5,      27,       167,        1071,          6815,  ...
   0,    17,     441,     10673,      262305,       6525377,  ...
  -2,  -121,  -11529,  -1337713,  -161721441,  -19802585281,  ...
		

Crossrefs

Columns k=0-2 give A105523, A202038, A193544.
Main diagonal gives A292920.
Cf. A290569.

Programs

  • Mathematica
    Table[Function[k, SeriesCoefficient[1/(1 + ContinuedFractionK[-(-1)^i i^k x, 1, {i, 1, n}]), {x, 0, n}]][j - n], {j, 0, 9}, {n, 0, j}] // Flatten

Formula

G.f. of column k: 1/(1 + x/(1 - 2^k*x/(1 + 3^k*x/(1 - 4^k*x/(1 + 5^k*x/(1 - ...)))))), a continued fraction.

A331405 G.f.: 1/(1 - 1*2*x/(1 + 2*3*x/(1 - 3*4*x/(1 + 4*5*x/(1 - 5*6*x/(1 + ...)))))), a continued fraction.

Original entry on oeis.org

1, 2, -8, -112, 2176, 71936, -3163136, -196237312, 15258124288, 1531746516992, -185088737017856, -27405687884087296, 4747122204712370176, 973473732763710390272, -228670532983871365971968, -62056343388674412796444672, 18982531521384459634512756736
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 16 2020

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 16; CoefficientList[Series[1/(1 + ContinuedFractionK[(-1)^k k (k + 1) x, 1, {k, 1, nmax}]), {x, 0, nmax}], x]

Formula

a(n) ~ sin((2*n+1)*Pi/4) * 2^(6*n + 8) * Pi^(n + 3/2) * n^(2*n + 3/2) / (exp(2*n) * Gamma(1/4)^(4*n + 4)). - Vaclav Kotesovec, Jan 28 2020
Showing 1-10 of 13 results. Next