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.

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

A122432 Riordan array (1/(1+x)^3,x).

Original entry on oeis.org

1, -3, 1, 6, -3, 1, -10, 6, -3, 1, 15, -10, 6, -3, 1, -21, 15, -10, 6, -3, 1, 28, -21, 15, -10, 6, -3, 1, -36, 28, -21, 15, -10, 6, -3, 1, 45, -36, 28, -21, 15, -10, 6, -3, 1, -55, 45, -36, 28, -21, 15, -10
Offset: 0

Views

Author

Paul Barry, Sep 04 2006

Keywords

Comments

Sequence array for (-1)^n*C(n+2,2). Inverse of A122431. Row sums are -A083392(n+1). Antidiagonal sums are (-1)^n*A002623(n).
Call the unsigned version of this array M and for k = 0,1,2,... define M(k) to be the lower unit triangular block array
/I_k 0\
\ 0 M/
having the k X k identity matrix I_k as the upper left block; in particular, M(0) = M. The infinite matrix product M(0)*M(1)*M(2)*..., which is clearly well-defined, is equal to A127893. - Peter Bala, Jul 22 2014
From Wolfdieter Lang, Apr 05 2020: (Start)
Triangle T(n, k) has the k=0 column (-1)^n*A000217(n+1) = (-1)^n*binomial(n+2, 2), then repeated and down-shifted.
The unsigned triangle, i.e., Tup(n, k) := (-1)^(n-k)*T(n-1,k-1) = binomial(n-k+2, 2) with n >= 1, k = 1..n, gives the number of triangles of length k (in some units), for k = 1..n, in the matchstick arrangement (or tower of cards, with n cards as basis) with an enclosing triangle of length n, but only triangles with orientation (up) like the enclosing triangle are counted. The total number of matchsticks (cards) is 3*A000217(n). (See the comment by Andrew Howroyd in A085691). Recurrence: Tup(n, k) = 0 for n < k, Tup(1, 1) = 1, and Tup(n, k) = Tup(n-1, k) + n - k + 1, for n >= 2, k = 1..n. Row sums give A000292(n). (End)

Examples

			The triangle T(n, k) begins:
n\k  0   1   2   3   4   5   6  7  8  9 ...
-------------------------------------------
0:   1
1  :-3   1
2:   6  -3   1
3: -10   6  -3   1
4:  15 -10   6  -3   1
5; -21  15 -10   6  -3   1
6:  28 -21  15 -10   6  -3   1
7: -36  28 -21  15 -10   6  -3  1
8:  45 -36  28 -21  15 -10   6 -3  1
9: -55  45 -36  28 -21  15 -10  6 -3  1
... reformattet by - _Wolfdieter Lang_, Apr 05 2020
		

Crossrefs

Programs

  • Magma
    /* As triangle */ [[(-1)^(n-k)*Binomial(n-k+2, 2): k in [1..n]]: n in [1..10]]; // G. C. Greubel, Oct 29 2017
  • Mathematica
    Table[(-1)^(n - k)*Binomial[n - k + 2, 2], {n, 0, 49}, {k, 0, n}] // Flatten (* G. C. Greubel, Oct 29 2017 *)
  • PARI
    for(n=0,10, for(k=0,n, print1((-1)^(n-k)*binomial(n-k+2,2), ", "))) \\ G. C. Greubel, Oct 29 2017
    

Formula

Number triangle T(n, k) = [k<=n]*(-1)^(n-k)*binomial(n-k+2, 2).
Recurrence: T(n, k) = - T(n-1, k) + (-1)^(n-k)*(n-k+1), for n >= 0, and k = 0..n. - Wolfdieter Lang, Apr 06 2020

A332566 a(n) is the permanent of an n X n 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

1, 0, 1, 2, 16, 150, 2333, 45840, 1227816, 40715300, 1701223409, 84902728550, 5108474886424, 357837483830570, 29336856811970045, 2745407159100236484, 294324995624694053072, 35473014438701226021416, 4818705384665419284918401, 727012502373285844943278058, 122057159014198483893887865744
Offset: 0

Views

Author

Stefano Spezia, Feb 16 2020

Keywords

Examples

			For n = 4 the matrix M(4) is
    0 1 1 2
    1 0 1 1
    1 1 0 1
    2 1 1 0
with permanent a(4) = 16.
		

Crossrefs

Programs

  • Mathematica
    nmax:=20; k[i_]:=Floor[i/2];a[n_]:=If[n==0,1,Permanent[ToeplitzMatrix[Array[k, n], Array[k, n]]]]; Table[a[n],{n,0,nmax}]
  • PARI
    tm(n) = {my(m = matrix(n, n, i, j, if (i==1, floor(j/2), if (j==1, floor(i/2))))); for (i=2, n, for (j=2, n, m[i, j] = m[i-1, j-1]; ); ); m; }
    a(n) = matpermanent(tm(n));

A266085 Alternating sum of heptagonal numbers.

Original entry on oeis.org

0, -1, 6, -12, 22, -33, 48, -64, 84, -105, 130, -156, 186, -217, 252, -288, 328, -369, 414, -460, 510, -561, 616, -672, 732, -793, 858, -924, 994, -1065, 1140, -1216, 1296, -1377, 1462, -1548, 1638, -1729, 1824, -1920, 2020, -2121, 2226, -2332, 2442, -2553
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 21 2015

Keywords

Crossrefs

Unsigned terms give antidiagonal sums of A204154. - Nathaniel J. Strout, Nov 14 2019

Programs

  • Magma
    [((10*n^2+4*n-3)*(-1)^n+3)/8: n in [0..50]]; // Vincenzo Librandi, Dec 21 2015
    
  • Magma
    R:=PowerSeriesRing(Integers(), 50); [0] cat  Coefficients(R!(-x*(1 - 4*x)/((1 - x)*(1 + x)^3))); // Marius A. Burtea, Nov 13 2019
    
  • Mathematica
    Table[((10 n^2 + 4 n - 3) (-1)^n + 3)/8, {n, 0, 50}]
    CoefficientList[Series[(x - 4 x^2)/(x^4 + 2 x^3 - 2 x - 1), {x, 0, 50}], x] (* Vincenzo Librandi, Dec 21 2015 *)
    LinearRecurrence[{-2,0,2,1},{0,-1,6,-12},60] (* Harvey P. Dale, Jan 26 2023 *)
  • PARI
    x='x+O('x^100); concat(0, Vec(-x*(1-4*x)/((1-x)*(1+x)^3))) \\ Altug Alkan, Dec 21 2015

Formula

G.f.: -x*(1 - 4*x)/((1 - x)*(1 + x)^3).
a(n) = ((10*n^2 + 4*n - 3)*(-1)^n + 3)/8.
a(n) = Sum_{k = 0..n} (-1)^k*A000566(k).
Lim_{n -> infinity} a(n + 1)/a(n) = -1.
a(n) = (-1)^n*A008728(5*n-5) for n>0. - Bruno Berselli, Dec 21 2015
E.g.f.: (1/8)*exp(-x)*(-3 + 3*exp(2*x) - 14*x + 10*x^2). - Stefano Spezia, Nov 13 2019

A331491 a(n) is the permanent of a 2n X 2n antisymmetric 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, 8, -965, 301864, -276973609, 529706205072, -1976989515848629, 12817424808315680000, -136266429300554940901097, 2240244443768853657066332152, -54675928167021488863788002983045, 1910142516402733768189592370043464696, -92787876901046051283841308281722409846473
Offset: 0

Views

Author

Stefano Spezia, Jan 18 2020

Keywords

Comments

Conjecture: for n > 0, det(M(2n)) = n^2 = A000290(n) with det(M(0)) = 1.

Examples

			For n = 2 the matrix M(4) is
   0  1  1  2
  -1  0  1  1
  -1 -1  0  1
  -2 -1 -1  0
with permanent a(2) = 8.
		

Crossrefs

Programs

  • Mathematica
    nmax:=13; k[i_]:=Floor[i/2]; a[n_]:=If[n==0,1,Permanent[ToeplitzMatrix[-Array[k, n], Array[k, n]]]]; Table[a[2n],{n,0,nmax}]
  • PARI
    tm(n) = {my(m = matrix(n, n, i, j, if (i==1, floor(j/2), if (j==1, -floor(i/2))))); for (i=2, n, for (j=2, n, m[i, j] = m[i-1, j-1]; ); ); m; }
    a(n) = matpermanent(tm(2*n));

A266086 Alternating sum of 9-gonal (or nonagonal) numbers.

Original entry on oeis.org

0, -1, 8, -16, 30, -45, 66, -88, 116, -145, 180, -216, 258, -301, 350, -400, 456, -513, 576, -640, 710, -781, 858, -936, 1020, -1105, 1196, -1288, 1386, -1485, 1590, -1696, 1808, -1921, 2040, -2160, 2286, -2413, 2546, -2680, 2820, -2961, 3108, -3256, 3410
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 21 2015

Keywords

Crossrefs

Programs

  • Magma
    [(14*(-1)^n*n^2 + 4*(-1)^n*n - 5*(-1)^n + 5)/8: n in [0..50]]; // Vincenzo Librandi, Dec 21 2015
    
  • Mathematica
    Table[((14 n^2 + 4 n - 5) (-1)^n + 5)/8, {n, 0, 44}]
    CoefficientList[Series[(x - 6 x^2)/(x^4 + 2 x^3 - 2 x - 1), {x, 0, 50}], x] (* Vincenzo Librandi, Dec 21 2015 *)
  • PARI
    x='x+O('x^100); concat(0, Vec(-x*(1-6*x)/((1-x)*(1+x)^3))) \\ Altug Alkan, Dec 21 2015

Formula

G.f.: -x*(1 - 6*x)/((1 - x)*(1 + x)^3).
a(n) = ((14*n^2 + 4*n - 5)*(-1)^n + 5)/8.
a(n) = Sum_{k = 0..n} (-1)^k*A001106(k).
Lim_{n -> infinity} a(n + 1)/a(n) = -1.

A266087 Alternating sum of 11-gonal (or hendecagonal) numbers.

Original entry on oeis.org

0, -1, 10, -20, 38, -57, 84, -112, 148, -185, 230, -276, 330, -385, 448, -512, 584, -657, 738, -820, 910, -1001, 1100, -1200, 1308, -1417, 1534, -1652, 1778, -1905, 2040, -2176, 2320, -2465, 2618, -2772, 2934, -3097, 3268, -3440, 3620, -3801, 3990, -4180
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 21 2015

Keywords

Crossrefs

Programs

  • Magma
    [(18*(-1)^n*n^2 + 4*(-1)^n*n - 7*(-1)^n + 7)/8: n in [0..50]]; // Vincenzo Librandi, Dec 21 2015
    
  • Mathematica
    Table[((18 n^2 + 4 n - 7) (-1)^n + 7)/8, {n, 0, 43}]
    CoefficientList[Series[(x - 8 x^2)/(x^4 + 2 x^3 - 2 x - 1), {x, 0, 50}], x] (* Vincenzo Librandi, Dec 21 2015 *)
    Accumulate[Times@@@Partition[Riffle[PolygonalNumber[11,Range[0,50]],{1,-1},{2,-1,2}],2]] (* Requires Mathematica version 10 or later *) (* or *) LinearRecurrence[{-2,0,2,1},{0,-1,10,-20},50] (* Harvey P. Dale, Aug 27 2019 *)
  • PARI
    x='x+O('x^100); concat(0, Vec(-x*(1-8*x)/((1-x)*(1+x)^3))) \\ Altug Alkan, Dec 21 2015

Formula

G.f.: -x*(1 - 8*x)/((1 - x)*(1 + x)^3).
a(n) = ((18*n^2 + 4*n - 7)*(-1)^n + 7)/8.
a(n) = Sum_{k = 0..n} (-1)^k*A051682(k).
Lim_{n -> infinity} a(n + 1)/a(n) = -1.
E.g.f.: (1/4)*(9*x^2 - 11*x)*cosh(x) - (1/4)*(9*x^2 - 11*x - 7)*sinh(x). - G. C. Greubel, Jan 27 2016

A266088 Alternating sum of 12-gonal (or dodecagonal) numbers.

Original entry on oeis.org

0, -1, 11, -22, 42, -63, 93, -124, 164, -205, 255, -306, 366, -427, 497, -568, 648, -729, 819, -910, 1010, -1111, 1221, -1332, 1452, -1573, 1703, -1834, 1974, -2115, 2265, -2416, 2576, -2737, 2907, -3078, 3258, -3439, 3629, -3820, 4020, -4221, 4431, -4642
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 21 2015

Keywords

Comments

More generally, the ordinary generating function for the alternating sum of k-gonal numbers is -x*(1 - (k - 3)*x)/((1 - x)*(1 + x)^3).

Crossrefs

Programs

  • Magma
    [1+(-1)^n*(5*n^2+n-2)/2: n in [0..50]]; // Vincenzo Librandi, Dec 21 2015
    
  • Mathematica
    Table[1 + (-1)^n (5 n^2 + n - 2)/2, {n, 0, 43}]
    CoefficientList[Series[-x (1 - 9 x)/((1 - x) (1 + x)^3), {x, 0, 50}], x] (* Vincenzo Librandi, Dec 21 2015 *)
  • PARI
    x='x+O('x^100); concat(0, Vec(-x*(1-9*x)/((1-x)*(1+x)^3))) \\ Altug Alkan, Dec 21 2015

Formula

G.f.: -x*(1 - 9*x)/((1 - x)*(1 + x)^3).
a(n) = 1 + (-1)^n*(5*n^2 + n - 2)/2.
a(n) = Sum_{k = 0..n} (-1)^k*A051624(k).
Lim_{n -> infinity} a(n + 1)/a(n) = -1.

A267831 Expansion of (1 + 5*x - 7*x^2 - 3*x^3)/((1 - x)*(1 + x^2)^2).

Original entry on oeis.org

1, 6, -3, -16, 1, 22, -3, -32, 1, 38, -3, -48, 1, 54, -3, -64, 1, 70, -3, -80, 1, 86, -3, -96, 1, 102, -3, -112, 1, 118, -3, -128, 1, 134, -3, -144, 1, 150, -3, -160, 1, 166, -3, -176, 1, 182, -3, -192, 1, 198, -3, -208, 1, 214, -3, -224, 1, 230, -3, -240, 1, 246, -3, -256, 1, 262, -3
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 21 2016

Keywords

Examples

			a(0) = (0 + 1) = 1;
a(1) = (0 + 1) + (2 + 3) = 6;
a(2) = (0 + 1) + (2 + 3) - (4 + 5) = -3;
a(3) = (0 + 1) + (2 + 3) - (4 + 5) - (6 + 7) = -16;
a(4) = (0 + 1) + (2 + 3) - (4 + 5) - (6 + 7) + (8 + 9) = 1;
a(5) = (0 + 1) + (2 + 3) - (4 + 5) - (6 + 7) + (8 + 9) + (10 + 11) = 22, etc.
		

Crossrefs

Programs

  • Magma
    &cat [[1,2*(8*n+3),-3,-16*(n+1)]: n in [0..17]]; // Bruno Berselli, Jan 21 2016
    
  • Magma
    I:=[1,6,-3,-16,1]; [n le 5 select I[n] else Self(n-1)-2*Self(n-2)+2*Self(n-3)-Self(n-4)+Self(n-5): n in [1..70]]; // Vincenzo Librandi, Jan 21 2016
    
  • Mathematica
    Table[Sum[(-1)^(1/2 - Sin[(2 k + 1) (Pi/4)]/Sqrt[2]) (4 k + 1), {k, 0, n}], {n, 0, 70}]
    Table[-8 Floor[(n - 3)/4]^2 - 21 Floor[(n - 3)/4] - 8 Floor[(n - 2)/4]^2 + 8 Floor[(n - 1)/4]^2 + 8 Floor[n/4]^2 - 17 Floor[(n - 2)/4] + 13 Floor[(n - 1)/4] + 9 Floor[n/4] - 16, {n, 0, 70}]
    Table[-1 + (2 + (1 + 4 n) (1 - (-1)^n)/2) (-1)^((n - 1) n/2), {n, 0, 70}] (* Bruno Berselli, Jan 21 2016 *)
    LinearRecurrence[{1, -2, 2, -1, 1}, {1, 6, -3, -16, 1}, 70] (* Vincenzo Librandi, Jan 21 2016 *)
  • PARI
    Vec((1 + 5*x - 7*x^2 - 3*x^3)/((1 - x)*(1 + x^2)^2) + O(x^70)) \\ Michel Marcus, Oct 29 2017
  • Sage
    [-1+(2+(1+4*n)*(1-(-1)^n)/2)*(-1)^((n-1)*n/2) for n in (0..70)]; # Bruno Berselli, Jan 21 2016
    

Formula

G.f.: (1 + 5*x - 7*x^2 - 3*x^3)/((1 - x)*(1 + x^2)^2).
a(n) = Sum_{k = 0..n} (-1)^(1/2 - sin((2*k + 1)*Pi/4)/sqrt(2))*(4*k + 1).
a(n) = -8*floor((n - 3)/4)^2 - 21*floor((n - 3)/4) - 8*floor((n - 2)/4)^2 + 8*floor((n - 1)/4)^2 + 8*floor(n/4)^2 - 17*floor((n - 2)/4) + 13*floor((n - 1)/4) + 9*floor(n/4) - 16.
a(n) = -1 + (2 + (1 + 4*n)*(1 - (-1)^n)/2)*(-1)^((n-1)*n/2). Therefore: a(4*k) = 1, a(4*k+1) = 2*(8*k+3), a(4*k+2) = -3, a(4*k+3) = -16*(k+1). [Bruno Berselli, Jan 21 2016]

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