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.

Previous Showing 31-38 of 38 results.

A138350 Moment sequence of tr(A^2) in USp(4).

Original entry on oeis.org

1, -1, 3, -6, 20, -50, 175, -490, 1764, -5292, 19404, -60984, 226512, -736164, 2760615, -9202050, 34763300, -118195220, 449141836, -1551580888, 5924217936, -20734762776, 79483257308, -281248448936, 1081724803600, -3863302870000, 14901311070000, -53644719852000
Offset: 0

Views

Author

Andrew V. Sutherland, Mar 16 2008

Keywords

Comments

If A is a random matrix in the compact group USp(4) (4 X 4 complex matrices which are unitary and symplectic), then a(n) = E[(tr(A^2))^n] is the n-th moment of the trace of A^2. See A138351 for central moments.

Examples

			a(5) = -50 because E[(tr(A^2))^5] = -50 for a random matrix A in USp(4).
a(5) = A126120(5)*A138364(6)-A138364(5)*A126120(6) = 0*0-10*5 = -50.
		

Crossrefs

A signed version of A005558, which is the main entry for this sequence.

Programs

  • Mathematica
    a[n_] := 1/2*Binomial[2*Floor[n/2]+1, Floor[n/2]+1]*CatalanNumber[1/2*(n+Mod[n, 2])]*(Mod[n, 2]+2); Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Mar 13 2014 *)

Formula

a(n)=(1/2)Integral_{x=0..Pi,y=0..Pi}(2cos(2x)+2cos(2y))^n(2cos(x)-2cos(y))^2(2/Pi*sin^2(x))(2/Pi*sin^2(y))dxdy. a(n)=A126120(n)A138364(n+1)-A138364(n)A126120(n+1)
Conjectured e.g.f. BesselI[1,2x](BesselI[0,2x]-BesselI[1,2x])/x. - Benjamin Phillabaum, Feb 25 2011

A189230 Complementary Catalan triangle read by rows.

Original entry on oeis.org

0, 1, 0, 0, 2, 0, 3, 0, 3, 0, 0, 8, 0, 4, 0, 10, 0, 15, 0, 5, 0, 0, 30, 0, 24, 0, 6, 0, 35, 0, 63, 0, 35, 0, 7, 0, 0, 112, 0, 112, 0, 48, 0, 8, 0, 126, 0, 252, 0, 180, 0, 63, 0, 9, 0, 0, 420, 0, 480, 0, 270, 0, 80, 0, 10, 0, 462, 0, 990, 0, 825, 0, 385, 0, 99, 0, 11, 0
Offset: 0

Views

Author

Peter Luschny, May 01 2011

Keywords

Comments

T(n,k) = A189231(n,k)*((n - k) mod 2). For comparison: the classical Catalan triangle is A053121(n,k) = A189231(n,k)*((n-k+1) mod 2).
T(n,0) = A138364(n). Row sums: A100071.

Examples

			[0]  0,
[1]  1,  0,
[2]  0,  2,  0,
[3]  3,  0,  3,  0,
[4]  0,  8,  0,  4,  0,
[5] 10,  0, 15,  0,  5, 0,
[6]  0, 30,  0, 24,  0, 6, 0,
[7] 35,  0, 63,  0, 35, 0, 7, 0,
   [0],[1],[2],[3],[4],[5],[6],[7]
		

Crossrefs

Programs

  • Maple
    A189230 := (n,k) -> A189231(n,k)*modp(n-k,2):
    seq(print(seq(A189230(n,k),k=0..n)),n=0..11);
  • Mathematica
    t[n_, k_] /; (k>n || k<0) = 0; t[n_, n_] = 1; t[n_, k_] := t[n, k] = t[n-1, k-1] + Mod[n-k, 2] t[n-1, k] + t[n-1, k+1];
    T[n_, k_] := t[n, k] Mod[n-k, 2];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] (* Jean-François Alcover, Jun 24 2019 *)

A347048 Number of even-length ordered factorizations of n with integer alternating product.

Original entry on oeis.org

1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 4, 0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 6, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 11, 0, 0, 0, 1, 0, 0, 0, 11, 0, 0, 1, 1, 0, 0, 0, 6, 3, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 8, 0, 1, 1, 7, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Gus Wiseman, Oct 10 2021

Keywords

Comments

An ordered factorization of n is a sequence of positive integers > 1 with product n.
We define the alternating product of a sequence (y_1,...,y_k) to be Product_i y_i^((-1)^(i-1)).

Examples

			The a(n) ordered factorizations for n = 16, 32, 36, 48, 64, 96:
  4*4       8*4       6*6       12*4      8*8           24*4
  8*2       16*2      12*3      24*2      16*4          48*2
  2*2*2*2   2*2*4*2   18*2      2*2*6*2   32*2          3*2*8*2
            4*2*2*2   2*2*3*3   3*2*4*2   2*2*4*4       4*2*6*2
                      2*3*3*2   4*2*3*2   2*2*8*2       6*2*4*2
                      3*2*2*3   6*2*2*2   2*4*4*2       8*2*3*2
                      3*3*2*2             4*2*2*4       12*2*2*2
                                          4*2*4*2       2*2*12*2
                                          4*4*2*2
                                          8*2*2*2
                                          2*2*2*2*2*2
		

Crossrefs

Positions of 0's are A005117 \ {2}.
The restriction to powers of 2 is A027306.
Heinz numbers of partitions of this type are A028260 /\ A347457.
Positions of 3's appear to be A030514.
Positions of 1's are 1 and A082293.
Allowing non-integer alternating product gives A174725, unordered A339846.
The odd-length version is A347049.
The unordered version is A347438, reverse A347439.
Allowing any length gives A347463.
Partitions of this type are counted by A347704, reverse A035363.
A001055 counts factorizations (strict A045778, ordered A074206).
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A119620 counts partitions with alternating product 1, ranked by A028982.
A273013 counts ordered factorizations of n^2 with alternating product 1.
A339890 counts odd-length factorizations, ordered A174726.
A347050 = factorizations with alternating permutation, complement A347706.
A347437 = factorizations with integer alternating product, reverse A347442.
A347446 = partitions with integer alternating product, reverse A347445.
A347460 counts possible alternating products of factorizations.

Programs

  • Mathematica
    ordfacs[n_]:=If[n<=1,{{}},Join@@Table[Prepend[#,d]&/@ordfacs[n/d],{d,Rest[Divisors[n]]}]];
    altprod[q_]:=Product[q[[i]]^(-1)^(i-1),{i,Length[q]}];
    Table[Length[Select[ordfacs[n],EvenQ[Length[#]]&&IntegerQ[altprod[#]]&]],{n,100}]
  • PARI
    A347048(n, m=n, ap=1, e=0) = if(1==n,!(e%2) && 1==numerator(ap), sumdiv(n, d, if(d>1, A347048(n/d, d, ap * d^((-1)^e), 1-e)))); \\ Antti Karttunen, Jul 28 2024

Formula

a(n) = A347463(n) - A347049(n).

Extensions

Data section extended up to a(105) by Antti Karttunen, Jul 28 2024

A349153 Numbers k such that the k-th composition in standard order has sum equal to twice its reverse-alternating sum.

Original entry on oeis.org

0, 11, 12, 14, 133, 138, 143, 148, 155, 158, 160, 168, 179, 182, 188, 195, 198, 204, 208, 216, 227, 230, 236, 240, 248, 2057, 2066, 2071, 2077, 2084, 2091, 2094, 2101, 2106, 2111, 2120, 2131, 2134, 2140, 2149, 2154, 2159, 2164, 2171, 2174, 2192, 2211, 2214
Offset: 1

Views

Author

Gus Wiseman, Nov 17 2021

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i.

Examples

			The terms and corresponding compositions begin:
    0: ()
   11: (2,1,1)
   12: (1,3)
   14: (1,1,2)
  133: (5,2,1)
  138: (4,2,2)
  143: (4,1,1,1,1)
  148: (3,2,3)
  155: (3,1,2,1,1)
  158: (3,1,1,1,2)
  160: (2,6)
  168: (2,2,4)
  179: (2,1,3,1,1)
  182: (2,1,2,1,2)
  188: (2,1,1,1,3)
		

Crossrefs

These compositions are counted by A262977 up to 0's.
Except for 0, a subset of A345917.
The unreversed version is A348614.
The unreversed negative version is A349154.
The negative version is A349155.
A non-reverse unordered version is A349159, counted by A000712 up to 0's.
An unordered version is A349160, counted by A006330 up to 0's.
A003242 counts Carlitz compositions.
A011782 counts compositions.
A025047 counts alternating or wiggly compositions, complement A345192.
A034871, A097805, and A345197 count compositions by alternating sum.
A103919 counts partitions by alternating sum, reverse A344612.
A116406 counts compositions with alternating sum >=0, ranked by A345913.
A138364 counts compositions with alternating sum 0, ranked by A344619.
Statistics of standard compositions:
- The compositions themselves are the rows of A066099.
- Number of parts is given by A000120, distinct A334028.
- Sum and product of parts are given by A070939 and A124758.
- Maximum and minimum parts are given by A333766 and A333768.
- Heinz number is given by A333219.
Classes of standard compositions:
- Partitions and strict partitions are ranked by A114994 and A333256.
- Multisets and sets are ranked by A225620 and A333255.
- Strict and constant compositions are ranked by A233564 and A272919.
- Carlitz compositions are ranked by A333489, complement A348612.
- Alternating compositions are ranked by A345167, complement A345168.

Programs

  • Mathematica
    stc[n_]:=Differences[ Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    sats[y_]:=Sum[(-1)^(i-Length[y])*y[[i]],{i,Length[y]}];
    Select[Range[0,1000],Total[stc[#]]==2*sats[stc[#]]&]

A359364 Triangle read by rows. The Motzkin triangle, the coefficients of the Motzkin polynomials. M(n, k) = binomial(n, k) * CatalanNumber(k/2) if k is even, otherwise 0.

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 1, 0, 3, 0, 1, 0, 6, 0, 2, 1, 0, 10, 0, 10, 0, 1, 0, 15, 0, 30, 0, 5, 1, 0, 21, 0, 70, 0, 35, 0, 1, 0, 28, 0, 140, 0, 140, 0, 14, 1, 0, 36, 0, 252, 0, 420, 0, 126, 0, 1, 0, 45, 0, 420, 0, 1050, 0, 630, 0, 42, 1, 0, 55, 0, 660, 0, 2310, 0, 2310, 0, 462, 0
Offset: 0

Views

Author

Peter Luschny, Jan 09 2023

Keywords

Comments

The generalized Motzkin numbers M(n, k) are a refinement of the Motzkin numbers M(n) (A001006) in the sense that they are coefficients of polynomials M(n, x) = Sum_{n..k} M(n, k) * x^k that take the value M(n) at x = 1. The coefficients of x^n are the aerated Catalan numbers A126120.
Variants are the irregular triangle A055151 with zeros deleted, A097610 with reversed rows, A107131 and A080159.
In the literature the name 'Motzkin triangle' is also used for the triangle A026300, which is generated from the powers of the generating function of the Motzkin numbers.

Examples

			Triangle M(n, k) starts:
[0] 1;
[1] 1, 0;
[2] 1, 0,  1;
[3] 1, 0,  3, 0;
[4] 1, 0,  6, 0,   2;
[5] 1, 0, 10, 0,  10, 0;
[6] 1, 0, 15, 0,  30, 0,   5;
[7] 1, 0, 21, 0,  70, 0,  35, 0;
[8] 1, 0, 28, 0, 140, 0, 140, 0,  14;
[9] 1, 0, 36, 0, 252, 0, 420, 0, 126, 0;
		

Crossrefs

Cf. A001006 (Motzkin numbers), A026300 (Motzkin gf. triangle), A126120 (aerated Catalan), A000108 (Catalan).

Programs

  • Maple
    CatalanNumber := n -> binomial(2*n, n)/(n + 1):
    M := (n, k) -> ifelse(irem(k, 2) = 1, 0, CatalanNumber(k/2)*binomial(n, k)):
    for n from 0 to 9 do seq(M(n, k), k = 0..n) od;
    # Alternative, as coefficients of polynomials:
    p := n -> hypergeom([(1 - n)/2, -n/2], [2], (2*x)^2):
    seq(print(seq(coeff(simplify(p(n)), x, k), k = 0..n)), n = 0..9);
    # Using the exponential generating function:
    egf := exp(x)*BesselI(1, 2*x*t)/(x*t): ser:= series(egf, x, 11):
    seq(print(seq(coeff(simplify(n!*coeff(ser, x, n)), t, k), k = 0..n)), n = 0..9);
  • Python
    from functools import cache
    @cache
    def M(n: int, k: int) -> int:
        if k %  2: return 0
        if n <  3: return 1
        if n == k: return (2 * (n - 1) * M(n - 2, n - 2)) // (n // 2 + 1)
        return (M(n - 1, k) * n) // (n - k)
    for n in range(10): print([M(n, k) for k in range(n + 1)])

Formula

Let p(n, x) = hypergeom([(1 - n)/2, -n/2], [2], (2*x)^2).
p(n, 1) = A001006(n); p(n, sqrt(2)) = A025235(n); p(n, 2) = A091147(n).
p(2, n) = A002522(n); p(3, n) = A056107(n).
p(n, n) = A359649(n); 2^n*p(n, 1/2) = A000108(n+1).
M(n, k) = [x^k] p(n, x).
M(n, k) = [t^k] (n! * [x^n] exp(x) * BesselI(1, 2*t*x) / (t*x)).
M(n, k) = [t^k][x^n] ((1 - x - sqrt((x-1)^2 - (2*t*x)^2)) / (2*(t*x)^2)).
M(n, n) = A126120(n).
M(n, n-1) = A138364(n), the number of Motzkin n-paths with exactly one flat step.
M(2*n, 2*n) = A000108(n), the number of peakless Motzkin paths having a total of n up and level steps.
M(4*n, 2*n) = A359647(n), the central terms without zeros.
M(2*n+2, 2*n) = A002457(n) = (-4)^n * binomial(-3/2, n).
Sum_{k=0..n} M(n - k, k) = A023426(n).
Sum_{k=0..n} k * M(n, k) = 2*A014531(n-1) = 2*GegenbauerC(n - 2, -n, -1/2).
Sum_{k=0..n} i^k*M(n, k) = A343773(n), (i the imaginary unit), is the excess of the number of even Motzkin n-paths (A107587) over the odd ones (A343386).
Sum_{k=0..n} Sum_{j=0..k} M(n, j) = A189912(n).
Sum_{k=0..n} Sum_{j=0..k} M(n, n-j) = modified A025179(n).
For a recursion see the Python program.

A124304 Riordan array (1, x*(1-x^2)).

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, -1, 0, 1, 0, 0, -2, 0, 1, 0, 0, 0, -3, 0, 1, 0, 0, 1, 0, -4, 0, 1, 0, 0, 0, 3, 0, -5, 0, 1, 0, 0, 0, 0, 6, 0, -6, 0, 1, 0, 0, 0, -1, 0, 10, 0, -7, 0, 1, 0, 0, 0, 0, -4, 0, 15, 0, -8, 0, 1, 0, 0, 0, 0, 0, -10, 0, 21, 0, -9, 0, 1, 0, 0, 0, 0, 1, 0, -20, 0, 28, 0, -10, 0, 1
Offset: 0

Views

Author

Paul Barry, Oct 25 2006

Keywords

Comments

T(2n,n) is a signed aerated version of C(2n,n).
Inverse is A124305.

Examples

			Triangle begins
  1;
  0,  1;
  0,  0,  1;
  0, -1,  0,  1;
  0,  0, -2,  0,  1;
  0,  0,  0, -3,  0,  1;
  0,  0,  1,  0, -4,  0,  1;
  0,  0,  0,  3,  0, -5,  0,  1;
  0,  0,  0,  0,  6,  0, -6,  0,  1;
		

Crossrefs

Cf. A014021 (diagonal sums), A050935 (row sums), A124305 (inverse).

Programs

  • Magma
    A124304:= func< n,k | (&+[(-1)^j*Binomial(k,k-j)*Binomial(k,n-k-j) : j in [0..n]]) >;
    [A124304(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Aug 18 2023
    
  • Mathematica
    A124304[n_, k_]:= Binomial[k, (n-k)/2]*(-1)^((n-k)/2)*(1+(-1)^(n-k))/2;
    Table[A124304[n, k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Aug 18 2023 *)
  • SageMath
    def A124304(n, k): return binomial(k, (n-k)//2)*(-1)^((n-k)//2)*(1+(-1)^(n-k))/2
    flatten([[A124304(n,k) for k in range(n+1)] for n in range(16)]) # G. C. Greubel, Aug 18 2023

Formula

T(n, k) = Sum_{j=0..n} C(k,k-j)*C(k,n-k-j)*(-1)^j.
T(n, k) = C(k,(n-k)/2)*(-1)^((n-k)/2)*(1 + (-1)^(n-k))/2.
Sum_{k=0..n} T(n, k) = A050935(n+2).
Sum_{k=0..floor(n/2)} T(n-k, k) = A014021(n).
T(2*n, n) = (1 - 2*0^(n+2 mod 4))*A126869(n).
From G. C. Greubel, Aug 18 2023: (Start)
T(2*n-1, n-1) = (1 - 2*0^(n+1 mod 4))*A138364(n-1).
T(2*n-1, n+1) = (1 - 2*0^(n mod 4))*((1+(-1)^n)/2)*A002054(floor(n/2)).
Sum_{k=0..n} (-1)^k*T(n, k) = A176971(n+3).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = (1 - 2*0^(n+2 mod 4))*A079977(n).
G.f.: 1/(1 - x*y*(1-x^2)). (End)

A292628 Square array A(n,k), n>=0, k>=0, read by antidiagonals, where column k is the expansion of e.g.f. exp(k*x)*BesselI(1,2*x).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 2, 3, 0, 1, 4, 6, 0, 0, 1, 6, 15, 16, 10, 0, 1, 8, 30, 56, 45, 0, 0, 1, 10, 51, 144, 210, 126, 35, 0, 1, 12, 78, 304, 685, 792, 357, 0, 0, 1, 14, 111, 560, 1770, 3258, 3003, 1016, 126, 0, 1, 16, 150, 936, 3885, 10224, 15533, 11440, 2907, 0, 0, 1, 18, 195, 1456, 7570, 26550, 58947, 74280, 43758, 8350, 462
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 20 2017

Keywords

Comments

A(n,k) is the k-th binomial transform of A138364 evaluated at n.

Examples

			E.g.f. of column k: A_k(x) = x/1! + 2*k*x^2/2! + 3*(k^2 + 1)*x^3/3! + 4*k*(k^2 + 3)*x^4/4! + 5*(k^4 + 6*k^2 + 2)*x^5/5! + ...
Square array begins:
   0,   0,    0,    0,     0,     0,  ...
   1,   1,    1,    1,     1,     1,  ...
   0,   2,    4,    6,     8,    10,  ...
   3,   6,   15,   30,    51,    78,  ...
   0,  16,   56,  144,   304,   560,  ...
  10,  45,  210,  685,  1770,  3885,  ...
		

Crossrefs

Columns k=0..3 give A138364, A005717, A001791, A026376.
Main diagonal gives A292629.
Cf. A292627.

Programs

  • Mathematica
    Table[Function[k, n! SeriesCoefficient[Exp[k x] BesselI[1, 2 x], {x, 0, n}]][j - n], {j, 0, 11}, {n, 0, j}] // Flatten

Formula

E.g.f. of column k: exp(k*x)*BesselI(1,2*x).

A138351 Central moment sequence of tr(A^2) in USp(4).

Original entry on oeis.org

1, 0, 2, 1, 11, 16, 95, 232, 1085, 3460, 14820, 54275, 227095, 895688, 3756688, 15462293, 65586405, 277342336, 1192038266, 5136760581, 22357937431, 97730561480, 430177280197, 1901975209706, 8454151507801, 37734802709796
Offset: 0

Views

Author

Andrew V. Sutherland, Mar 16 2008, Mar 31 2008

Keywords

Comments

If A is a random matrix in the compact group USp(4) (4 X 4 complex matrices which are unitary and symplectic), then a(n) = E[(tr(A^2)+1)^n] is the n-th central moment of the trace of A^2, since E[tr(A^2)] = -1 (see A138350).

Examples

			a(4) = 11 because E[(tr(A^2)+1)^4] = 11 for a random matrix A in USp(4).
a(4) = 1*A138350(0)+4*A138350(1)+6*A138350(2)+4*A138350(3)+1*A138350(4) = 1*1 + 4*(-1) + 6*3 + 4*(-6) + 1*20 = 11.
		

Crossrefs

Cf. A138350.

Programs

  • Mathematica
    a126120[n_] := If[EvenQ[n], CatalanNumber[n/2], 0];
    a138364[n_] := If[EvenQ[n], 0, Binomial[n, Floor[n/2]], 0];
    a138350[n_] := a126120[n] a138364[n+1] - a138364[n] a126120[n+1];
    a[n_] := Sum[Binomial[n, i] a138350[i], {i, 0, n}];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 13 2018 *)

Formula

a(n) = (1/2)Integral_{x=0..Pi,y=0..Pi}(2cos(2x)+2cos(2y)+1)^n(2cos(x)-2cos(y))^2(2/Pi*sin^2(x))(2/Pi*sin^2(y))dxdy.
a(n) = Sum_{i=0..n} binomial(n,i)*A138350(i).
Previous Showing 31-38 of 38 results.