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 41-50 of 54 results. Next

A089741 Triangle read by rows: T(n,k) = number of peakless Motzkin paths of length n containing k UHH...HD's, where U=(1,1), D=(1,-1) and H=(1,0) (can be easily expressed using RNA secondary structure terminology).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 7, 1, 15, 1, 1, 31, 5, 1, 63, 18, 1, 127, 56, 1, 1, 255, 160, 7, 1, 511, 432, 34, 1, 1023, 1120, 138, 1, 1, 2047, 2816, 500, 9, 1, 4095, 6912, 1672, 55, 1, 8191, 16640, 5264, 275, 1, 1, 16383, 39424, 15808, 1205, 11, 1, 32767, 92160, 45696, 4797
Offset: 0

Views

Author

Emeric Deutsch, Jan 08 2004

Keywords

Examples

			T(7,2)=5 because we have H(UHD)(UHD), (UHD)H(UHD), (UHD)(UHD)H, (UHD)(UHHD) and (UHHD)(UHD) (the required subwords are shown between parentheses).
Triangle begins:
  1;
  1;
  1;
  1,   1;
  1,   3;
  1,   7;
  1,  15,   1;
  1,  31,   5;
  1,  63,  18;
  1, 127,  56,   1;
  1, 255, 160,   7;
  ...
		

Crossrefs

Row sums yield A004148. Column 1 is A000225, column 2 is A001793.

Formula

G.f.: (1-2*z+2*z^2-t*z^3-sqrt((1-t*z^3)*(1-4*z+4*z^2-t*z^3)))/(2*z^2*(1-z)).

A097229 Triangle read by rows: number of Motzkin paths by length and by number of humps.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 7, 1, 1, 15, 5, 1, 31, 18, 1, 1, 63, 56, 7, 1, 127, 160, 34, 1, 1, 255, 432, 138, 9, 1, 511, 1120, 500, 55, 1, 1, 1023, 2816, 1672, 275, 11, 1, 2047, 6912, 5264, 1205, 81, 1, 1, 4095, 16640, 15808, 4797, 481, 13
Offset: 0

Views

Author

David Callan, Aug 01 2004

Keywords

Comments

T(n,k) = number of Motzkin paths of length n containing exactly k humps. (A hump is an upstep followed by 0 or more flatsteps followed by a downstep.)

Examples

			Example: Table begins
  n|
  -+------------------
  0|1
  1|1
  2|1,   1
  3|1,   3
  4|1,   7,   1
  5|1,  15,   5
  6|1,  31,  18,  1
  7|1,  63,  56,  7
  8|1, 127, 160, 34, 1
T(5,2) = 5 counts FUDUD, UDFUD, UDUDF, UDUFD, UFDUD.
		

Crossrefs

Column k=2 is A001793.
Cf. A001263.

Programs

  • Mathematica
    a[n_, k_]/;k<0 || k>n/2 := 0; a[n_, 0]/;n>=0 := 1; a[n_, k_]/;1<=k<=n := a[n, k] = a[n-1, k] + Sum[a[n-r, k-1], {r, 2, n}]+Sum[a[r-2, j]a[n-r, k-j], {r, 2, n}, {j, k}] (* This recurrence counts a(n, k) by first return to ground level. *)
  • Maxima
    N(n,k):=(binomial(n,k-1)*binomial(n,k))/n;
    T(n,k):=if k=0 then 1 else sum(binomial(n, 2*i)*N(i,k),i,1,n); /* Vladimir Kruchinin, Jan 08 2022 */

Formula

G.f.: ((-1 + 2*x - 2*x^2 + x^2*y + ((1 - 2*x)^2 + 2*x^2*(-1 + 2*x - 2*x^2)*y + x^4*y^2)^(1/2))/(2*(-1 + x)*x^2) = Sum_{n>=0, k>=0} a(n, k) x^n y^k satisfies x^2 A(x, y)^2 - ( x^2(1-y)/(1-x) + (1-x) )A(x, y) + 1 = 0.
T(n,k) = Sum_{i=1..n} binomial(n, 2*i)*N(i,k), T(n,0)=1, where N(n,k) is the triangle of Narayana numbers A001263. - Vladimir Kruchinin, Jan 08 2022

A102841 a(n) = ((9*n^2 + 33*n + 26)*2^n + (-1)^n)/27.

Original entry on oeis.org

1, 5, 19, 61, 179, 493, 1299, 3309, 8211, 19949, 47635, 112109, 260627, 599533, 1366547, 3089901, 6937107, 15476205, 34331155, 75769325, 166451731, 364127725, 793500179, 1723082221, 3729512979, 8048092653, 17319057939
Offset: 0

Views

Author

Creighton Dement, Feb 27 2005

Keywords

Comments

A floretion-generated sequence relating the number of edges and faces in n-dimensional hypercube.
Equals A001787, (1, 4, 12, 32, 80, ...) convolved with A001045, the Jacobsthal sequence. - Gary W. Adamson, May 23 2009
The sum of the sizes of all inversions in compositions of n. - Arnold Knopfmacher, Jan 22 2020

Crossrefs

Programs

  • Magma
    [((9*n^2 + 33*n + 26)*2^n + (-1)^n)/27 : n in [0..40]]; // Wesley Ivan Hurt, Jul 03 2020
  • Mathematica
    Table[(1/27)*((9 n^2 + 33 n + 26) 2^n + (-1)^n), {n, 0, 50}] (* or *) LinearRecurrence[{5,-6,-4,8}, {1,5,19,61}, 50] (* G. C. Greubel, Sep 27 2017 *)

Formula

G.f.: 1/((1+x)*(1-2*x)^3).
a(n+1) - 2*a(n) = A045883(n+2).
a(n) + a(n+1) = A001788(n+2).
a(n) = 5*a(n-1) - 6*a(n-2) - 4*a(n-3) + 8*a(n-4). - Wesley Ivan Hurt, Jul 03 2020

Extensions

Corrected by T. D. Noe, Nov 08 2006

A114593 Triangle read by rows: T(n,k) is the number of hill-free Dyck paths of semilength n, having k ascents of length at least 2 (1 <= k <= floor(n/2), n >= 2).

Original entry on oeis.org

1, 2, 4, 2, 8, 10, 16, 36, 5, 32, 112, 42, 64, 320, 224, 14, 128, 864, 960, 168, 256, 2240, 3600, 1200, 42, 512, 5632, 12320, 6600, 660, 1024, 13824, 39424, 30800, 5940, 132, 2048, 33280, 119808, 128128, 40040, 2574, 4096, 78848, 349440, 489216, 224224, 28028, 429
Offset: 2

Views

Author

Emeric Deutsch, Dec 11 2005

Keywords

Comments

Row n has floor(n/2) terms. Row sums are the Fine numbers (A000957). T(n,1) = 2^(n-2). T(n,2) = n(n-3)2^(n-5) (n>4) (2*A001793). T(2n,n) = Catalan(n). T(2n+1,n) = n*Catalan(n+1). Sum_{k=1..floor(n/2)} k*T(n,k) yields A114594.
T(n,k) is the number of permutations pi of [n-1] with k valleys such that s(pi) avoids the patterns 132, 231, and 312, where s is West's stack-sorting map. - Colin Defant, Sep 16 2018

Examples

			T(4,2)=2 because we have (UU)D(UU)DDD and (UU)DD(UU)DD, where U=(1,1), D=(1,-1) (ascents of length at least two are shown between parentheses).
Triangle starts:
   1;
   2;
   4,   2;
   8,  10;
  16,  36,   5;
  32, 112,  42;
  64, 320, 224,  14;
		

Crossrefs

Programs

  • Maple
    T:=proc(n,k) if k<=floor(n/2) then 2^(n-2*k)*binomial(n+1,k)*binomial(n-k-1,k-1)/(n+1) else 0 fi end: for n from 2 to 14 do seq(T(n,k),k=1..floor(n/2)) od;
  • Mathematica
    m = 13(*rows*); G = 0; Do[G = Series[(1 + G^2 (2 + t z) z)/(1 + 2 z), {t, 0, m+1}, {z, 0, m+1}] // Normal // Expand, {m+2}]; Rest[CoefficientList[ #, t]]& /@ CoefficientList[G-1, z][[3;;]] // Flatten (* Jean-François Alcover, Jan 22 2019 *)

Formula

T(n, k) = 2^(n-2k)*binomial(n+1, k)*binomial(n-k-1, k-1)/(n+1) (1 <= k <= floor(n/2)). G.f. = G-1, where G=G(t, z) satisfies z(2+tz)G^2 - (1+2z)G + 1 = 0.

A136523 Triangle T(n,k) = A053120(n,k) + A053120(n-1,k), read by rows.

Original entry on oeis.org

1, 1, 1, -1, 1, 2, -1, -3, 2, 4, 1, -3, -8, 4, 8, 1, 5, -8, -20, 8, 16, -1, 5, 18, -20, -48, 16, 32, -1, -7, 18, 56, -48, -112, 32, 64, 1, -7, -32, 56, 160, -112, -256, 64, 128, 1, 9, -32, -120, 160, 432, -256, -576, 128, 256, -1, 9, 50, -120, -400, 432, 1120, -576, -1280, 256, 512
Offset: 0

Views

Author

Roger L. Bagula, Mar 23 2008

Keywords

Examples

			Triangle begins as:
   1;
   1,  1;
  -1,  1,   2;
  -1, -3,   2,    4;
   1, -3,  -8,    4,    8;
   1,  5,  -8,  -20,    8,   16;
  -1,  5,  18,  -20,  -48,   16,   32;
  -1, -7,  18,   56,  -48, -112,   32,   64;
   1, -7, -32,   56,  160, -112, -256,   64,   128;
   1,  9, -32, -120,  160,  432, -256, -576,   128, 256;
  -1,  9,  50, -120, -400,  432, 1120, -576, -1280, 256, 512;
		

Crossrefs

Programs

  • Magma
    function A053120(n,k)
      if ((n+k) mod 2) eq 1 then return 0;
      elif n eq 0 then return 1;
      else return (-1)^Floor((n-k)/2)*(n/(n+k))*Binomial(Floor((n+k)/2), k)*2^k;
      end if;
    end function;
    A136523:= func< n,k | A053120(n,k) + A053120(n-1,k) >;
    [A136523(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 26 2023
    
  • Mathematica
    A053120[n_, k_]:= Coefficient[ChebyshevT[n,x], x, k];
    T[n_, k_]:= T[n, k]= A053120[n,k] + A053120[n-1,k];
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten
  • SageMath
    def A053120(n,k):
        if (n+k)%2==1: return 0
        elif n==0: return 1
        else: return floor((-1)^((n-k)//2)*(n/(n+k))*binomial((n+k)//2, k)*2^k)
    def A136523(n,k): return A053120(n,k) + A053120(n-1,k)
    flatten([[A136523(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Jul 26 2023

Formula

T(n, k) = A053120(n,k) + A053120(n-1,k).
Sum_{k=0..n} T(n, k) = A040000(n).
From G. C. Greubel, Jul 26 2023: (Start)
T(n, 0) = A057077(n).
T(n, 1) = (-1)^floor((n-1)/2) * A109613(n-1).
T(n, 2) = (-1)^floor((n-2)/2) * A008794(n-1).
T(n, 3) = (-1)^floor((n+1)/2) * A000330(n-1).
T(n, n) = A011782(n).
T(n, n-1) = A011782(n-1).
T(n, n-2) = -A001792(n-2).
T(n, n-4) = A001793(n-3).
T(n, n-6) = -A001794(n-6).
Sum_{k=0..n} (-1)^k*T(n,k) = A000007(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A000007(n) + [n=1].
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = (-1)^floor(n/2)*A025192(floor(n/2)). (End)

Extensions

Edited by G. C. Greubel, Jul 26 2023

A224288 Number of permutations of length n containing exactly 2 occurrences of 123 and 2 occurrences of 132.

Original entry on oeis.org

0, 0, 0, 0, 1, 6, 26, 94, 306, 934, 2732, 7752, 21488, 58432, 156288, 411904, 1071104, 2750976, 6984704, 17545216, 43634688, 107511808, 262602752, 636223488, 1529741312, 3652059136, 8660975616, 20412104704, 47826599936, 111446851584, 258360737792, 596044152832
Offset: 0

Views

Author

Brian Nakamura, Apr 03 2013

Keywords

Examples

			a(4) = 1: (1,2,4,3).
a(5) = 6: (2,3,5,1,4), (2,3,5,4,1), (2,5,1,3,4), (3,1,4,5,2), (4,1,2,5,3), (5,1,2,4,3).
		

Crossrefs

Programs

  • Maple
    # Programs can be obtained from the Nakamura link
  • Mathematica
    Join[{0, 0, 0, 0, 1}, LinearRecurrence[{10, -40, 80, -80, 32}, {6, 26, 94, 306, 934}, 27]] (* Jean-François Alcover, Feb 29 2020 *)

Formula

G.f.: -(2*x^5+6*x^4-6*x^3+6*x^2-4*x+1)*x^4/(2*x-1)^5. - Alois P. Heinz, Apr 03 2013
a(n) = 2^(-11+n)*(1504-994*n+219*n^2-18*n^3+n^4) for n>4. - Colin Barker, Apr 14 2013

A224290 Number of permutations of length n containing exactly 3 occurrences of 123 and 3 occurrences of 132.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 6, 30, 136, 566, 2176, 7808, 26440, 85332, 264632, 793792, 2315136, 6592640, 18390784, 50392064, 135921664, 361536512, 949708800, 2466807808, 6342115328, 16153509888, 40790523904, 102186352640, 254105092096, 627533152256, 1539764125696
Offset: 0

Views

Author

Brian Nakamura, Apr 03 2013

Keywords

Examples

			a(5) = 1: (1,4,3,2,5).
a(6) = 6: (2,5,4,3,1,6), (2,5,4,3,6,1), (3,5,1,4,6,2), (3,6,1,4,2,5), (5,1,4,3,2,6), (6,1,4,3,2,5).
		

Crossrefs

Programs

  • Maple
    # Programs can be obtained from the Nakamura link
  • Mathematica
    Join[{0, 0, 0, 0, 0, 1, 6}, LinearRecurrence[{14, -84, 280, -560, 672, -448, 128}, {30, 136, 566, 2176, 7808, 26440, 85332}, 33]] (* Jean-François Alcover, Nov 28 2018 *)
  • PARI
    concat([0,0,0,0,0], Vec(x^5*(1 - 8*x + 30*x^2 - 60*x^3 + 62*x^4 - 36*x^5 + 24*x^6 - 8*x^7 + 4*x^8) / (1 - 2*x)^7 + O(x^40))) \\ Colin Barker, Nov 28 2018

Formula

G.f.: -(4*x^8-8*x^7+24*x^6-36*x^5+62*x^4-60*x^3+30*x^2-8*x+1)*x^5 / (2*x-1)^7. - Alois P. Heinz, Apr 03 2013
From Colin Barker, Nov 28 2018: (Start)
a(n) = (1/9)*2^(n-15) * (307008 - 247512*n + 78118*n^2 - 12087*n^3 + 937*n^4 - 33*n^5 + n^6) for n>6.
a(n) = 14*a(n-1) - 84*a(n-2) + 280*a(n-3) - 560*a(n-4) + 672*a(n-5) - 448*a(n-6) + 128*a(n-7) for n>13.
(End)

A304635 Triangle T(n,j) read by rows: the number of j-faces in the hypersimplicial decomposition of the unit cube of n dimensions.

Original entry on oeis.org

1, 5, 2, 18, 14, 3, 56, 64, 27, 4, 160, 240, 150, 44, 5, 432, 800, 660, 288, 65, 6, 1120, 2464, 2520, 1456, 490, 90, 7, 2816, 7168, 8736, 6272, 2800, 768, 119, 8, 6912, 19968, 28224, 24192, 13440, 4896, 1134, 152, 9, 16640, 53760, 86400, 86016, 57120, 25920, 7980, 1600, 189, 10
Offset: 1

Views

Author

R. J. Mathar, May 15 2018

Keywords

Examples

			The triangle starts in row n>= for 1<=j<=n as:
  1,
5,2,
18,14,3,
56,64,27,4,
160,240,150,44,5,
432,800,660,288,65,6,
1120,2464,2520,1456,490,90,7,
2816,7168,8736,6272,2800,768,119,8,
6912,19968,28224,24192,13440,4896,1134,152,9,
16640,53760,86400,86016,57120,25920,7980,1600,189,10,
		

Crossrefs

Cf. A001793 (column j=1), A001794 (half of column j=2), A006974 (3rd of column j=3), A014106 (subdiagonal).

Programs

  • Maple
    A304635 := proc(n,j)
            j*2^(n-j-1)*(n+j+2)/(n+1)*binomial(n+1,j+1) ;
    end proc:

Formula

T(n,j) = j*2^(n-j-1)*(n+j+2)*binomial(n+,j+1)/(n+1).

A349427 a(n) = ((n+1)^2 - 2) * binomial(2*n-2,n-1) / 2.

Original entry on oeis.org

0, 1, 7, 42, 230, 1190, 5922, 28644, 135564, 630630, 2892890, 13117676, 58903572, 262303132, 1159666900, 5094808200, 22259364120, 96773942790, 418882316490, 1805951924700, 7758285404100, 33221013445620, 141830949914940, 603876402587640, 2564713671647400
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 17 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[((n + 1)^2 - 2) Binomial[2 n - 2, n - 1]/2, {n, 0, 24}]
    nmax = 24; CoefficientList[Series[x (1 - x) (1 - 2 x)/(1 - 4 x)^(5/2), {x, 0, nmax}], x]
  • PARI
    a(n) = ((n+1)^2 - 2) * binomial(2*n-2,n-1) / 2 \\ Andrew Howroyd, Nov 20 2021

Formula

G.f.: x * (1 - x) * (1 - 2*x) / (1 - 4*x)^(5/2).
E.g.f.: x * exp(2*x) * (2 * (1 + x) * BesselI(0,2*x) + (1 + 2*x) * BesselI(1,2*x)) / 2.
a(n) = n * ((n+1)^2 - 2) * Catalan(n-1) / 2.
a(n) = Sum_{k=0..n} binomial(n,k)^2 * A000217(k).
a(n) ~ 2^(2*n-3) * n^(3/2) / sqrt(Pi).
D-finite with recurrence (n-1)*(n^2-2)*a(n) -2*(2*n-3)*(n^2+2*n-1)*a(n-1)=0. - R. J. Mathar, Mar 06 2022

A091977 Triangle read by rows: T(n,k) is the number of Dyck paths of semilength n having k exterior pairs.

Original entry on oeis.org

1, 1, 2, 4, 1, 8, 5, 1, 16, 18, 7, 1, 32, 56, 34, 9, 1, 64, 160, 138, 55, 11, 1, 128, 432, 500, 275, 81, 13, 1, 256, 1120, 1672, 1205, 481, 112, 15, 1, 512, 2816, 5264, 4797, 2471, 770, 148, 17, 1, 1024, 6912, 15808, 17738, 11403, 4536, 1156, 189, 19, 1, 2048, 16640
Offset: 0

Views

Author

Emeric Deutsch, Mar 15 2004

Keywords

Comments

A pyramid in a Dyck word (path) is a factor of the form u^h d^h, h being the height of the pyramid. A pyramid in a Dyck word w is maximal if, as a factor in w, it is not immediately preceded by a u and immediately followed by a d.
The pyramid weight of a Dyck path (word) is the sum of the heights of its maximal pyramids. An exterior pair in a Dyck path is a pair consisting of a u and its matching d (when viewed as parentheses) which do not belong in any pyramid. Clearly, for a given Dyck path, the sum of its pyramid weight and the number of its exterior pairs is equal to the semilength of the path.
Triangle, with zeros omitted, given by (1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, ...) DELTA (0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, ...) where DELTA is the operator defined in A084938. - Philippe Deléham, Feb 06 2012

Examples

			T(4,1)=5 because the Dyck paths of semilength 4 having 1 exterior pair are: ud(u)udud(d), (u)udud(d)ud, (u)ududud(d), (u)uduudd(d) and (u)uuuddud(d) [the u and d that form the unique exterior pair are shown between parentheses].
Triangle begins:
[1],
[1],
[2],
[4, 1],
[8, 5, 1],
[16, 18, 7, 1],
[32, 56, 34, 9, 1],
[64, 160, 138, 55, 11, 1],
[128, 432, 500, 275, 81, 13, 1]
Triangle (1,1,0,1,1,0,1,1,...) DELTA (0,0,1,0,0,1,0,0,1,...) begins :
1
1, 0
2, 0, 0
4, 1, 0, 0
8, 5, 1, 0, 0
16, 18, 7, 1, 0, 0
32, 56, 34, 9, 1, 0, 0
64, 160, 138, 55, 11, 1, 0, 0...- _Philippe Deléham_, Feb 06 2012
		

Crossrefs

T(n, k)=A091866(n, n-k), T(n, 0)=2^(n-1) (n>0), T(n, 1)=A001793(n-2), row sums give the Catalan numbers (A000108).

Formula

G.f.=G=G(t, z) satisfies tz(1-z)G^2-(1+tz-2z)G+1-z=0.
Previous Showing 41-50 of 54 results. Next