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

A007595 a(n) = C_n / 2 if n is even or ( C_n + C_((n-1)/2) ) / 2 if n is odd, where C = Catalan numbers (A000108).

Original entry on oeis.org

1, 1, 3, 7, 22, 66, 217, 715, 2438, 8398, 29414, 104006, 371516, 1337220, 4847637, 17678835, 64823110, 238819350, 883634026, 3282060210, 12233141908, 45741281820, 171529836218, 644952073662, 2430973304732, 9183676536076, 34766775829452, 131873975875180
Offset: 1

Views

Author

Keywords

Comments

Number of necklaces of 2 colors with 2n beads and n-1 black ones. - Wouter Meeussen, Aug 03 2002
Number of rooted planar binary trees up to reflection (trees with n internal nodes, or a total of 2n+1 nodes). - Antti Karttunen, Aug 19 2002
Number of even permutations avoiding 132.
Number of Dyck paths of length 2n having an even number of peaks at even height. Example: a(3)=3 because we have UDUDUD, U(UD)(UD)D and UUUDDD, where U=(1,1), D=(1,-1) and the peaks at even height are shown between parentheses. - Emeric Deutsch, Nov 13 2004
Number of planar trees (A002995) on n edges with one distinguished edge. - David Callan, Oct 08 2005
Assuming offset 0 this is an analog of A275165: pairs of two Catalan nestings with index sum n. - R. J. Mathar, Jul 19 2016

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) = A047996(2*n, n-1) for n >= 1 and a(n) = A072506(n, n-1) for n >= 2.
Occurs in A073201 as rows 0, 2, 4, etc. (with a(0)=1 included).
Cf. also A003444, A007123.

Programs

  • Maple
    A007595 := n -> (1/2)*(Cat(n) + (`mod`(n,2)*Cat((n-1)/2))); Cat := n -> binomial(2*n,n)/(n+1);
  • Mathematica
    Table[(Plus@@(EulerPhi[ # ]Binomial[2n/#, (n-1)/# ] &)/@Intersection[Divisors[2n], Divisors[n-1]])/(2n), {n, 2, 32}] (* or *) Table[If[EvenQ[n], CatalanNumber[n]/2, (CatalanNumber[n] + CatalanNumber[(n-1)/2])/2], {n, 24}]
    Table[(CatalanNumber[n] + 2^n Binomial[1/2, (n + 1)/2] Sin[Pi n/2])/2, {n, 1, 20}] (* Vladimir Reshetnikov, Oct 03 2016 *)
    Table[If[EvenQ[n],CatalanNumber[n]/2,(CatalanNumber[n]+CatalanNumber[(n-1)/2])/2],{n,30}] (* Harvey P. Dale, Sep 06 2021 *)
  • PARI
    catalan(n) = binomial(2*n, n)/(n+1);
    a(n) = if (n % 2, (catalan(n) + catalan((n-1)/2))/2, catalan(n)/2); \\ Michel Marcus, Jan 23 2016

Formula

G.f.: (2-2*x-sqrt(1-4*x)-sqrt(1-4*x^2))/x/4. - Vladeta Jovovic, Sep 26 2003
D-finite with recurrence: n*(n+1)*a(n) -6*n*(n-1)*a(n-1) +4*(2*n^2-10*n+9)*a(n-2) +8*(n^2+n-9)*a(n-3) -48*(n-3)*(n-4)*a(n-4) +32*(2*n-9)*(n-5)*a(n-5)=0. - R. J. Mathar, Jun 03 2014, adapted to offset Feb 20 2020
a(n) ~ 4^n /(2*sqrt(Pi)*n^(3/2)). - Ilya Gutkovskiy, Jul 19 2016
a(2n) = A000150(2n). - R. J. Mathar, Jul 19 2016
a(n) = (A000108(n) + 2^n * binomial(1/2, (n+1)/2) * sin(Pi*n/2))/2. - Vladimir Reshetnikov, Oct 03 2016
Sum_{n>=1} a(n)/4^n = (3-sqrt(3))/2 (A334843). - Amiram Eldar, Mar 20 2022

Extensions

Description corrected by Reiner Martin and Wouter Meeussen, Aug 04 2002

A003445 Number of nonequivalent dissections of an n-gon into n-4 polygons by nonintersecting diagonals up to rotation.

Original entry on oeis.org

1, 2, 8, 40, 165, 712, 2912, 11976, 48450, 195580, 784504, 3139396, 12526605, 49902440, 198499200, 788795924, 3131945190, 12428258796, 49295766000, 195464345440, 774857314042, 3071175790232, 12171403236288, 48233597481200, 191138095393700, 757436171945952
Offset: 5

Views

Author

Keywords

Comments

In other words, the number of (n-5)-dissections of an n-gon modulo the cyclic action.
Equivalently, the number of two-dimensional faces of the (n-3)-dimensional associahedron modulo the cyclic action.
The dissection will always be composed of either 1 pentagon and n-5 triangles or 2 quadrilaterals and n-6 triangles. - Andrew Howroyd, Nov 24 2017

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A295633.

Programs

  • Maple
    C:=n->binomial(2*n,n)/(n+1);
    T31:=proc(n) local t1; global C;
    t1 :=  (n-3)^2*(n-4)*C(n-2)/(4*n*(2*n-5));
    if n mod 5 = 0 then t1:=t1+(4/5)*C(n/5-1) fi;
    if n mod 2 = 0 then t1:=t1+(n-4)*C(n/2-1)/8 fi;
    t1; end;
    [seq(T31(n),n=5..40)];
  • Mathematica
    Table[t1 = (n - 3)^2*(n - 4)*CatalanNumber[n - 2]/(4*n*(2*n - 5)); If[Mod[n, 5] == 0, t1 = t1 + (4/5)*CatalanNumber[n/5 - 1]]; If[Mod[n, 2] == 0, t1 = t1 + (n - 4)*CatalanNumber[n/2 - 1]/8]; t1, {n, 5, 20}] (* T. D. Noe, Jan 03 2013 *)
  • PARI
    \\ See A295495 for DissectionsModCyclic()
    { my(v=DissectionsModCyclic(apply(i->if(i>=3&&i<=5, y^(i-3) + O(y^3)), [1..30]))); apply(p->polcoeff(p, 2), v[5..#v]) } \\ Andrew Howroyd, Nov 24 2017

Formula

See Maple program.

Extensions

Entry revised (following Bowman and Regev) by N. J. A. Sloane, Dec 28 2012
Name clarified by Andrew Howroyd, Nov 25 2017

A003450 Number of nonequivalent dissections of an n-gon into n-4 polygons by nonintersecting diagonals up to rotation and reflection.

Original entry on oeis.org

1, 2, 6, 24, 89, 371, 1478, 6044, 24302, 98000, 392528, 1570490, 6264309, 24954223, 99253318, 394409402, 1565986466, 6214173156, 24647935156, 97732340680, 387428854374, 1535588541762, 6085702368796, 24116801236744, 95569050564444, 378718095630676
Offset: 5

Views

Author

Keywords

Comments

In other words, the number of (n - 5)-dissections of an n-gon modulo the dihedral action.
Equivalently, the number of two-dimensional faces of the (n-3)-dimensional associahedron modulo the dihedral action.
The dissection will always be composed of either 1 pentagon and n-5 triangles or 2 quadrilaterals and n-6 triangles. - Andrew Howroyd, Nov 24 2017

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A295634.

Programs

  • Maple
    C:=n->binomial(2*n,n)/(n+1);
    T32:=proc(n) local t1; global C;
    if n mod 2 = 0 then
    t1 :=  (n-3)^2*(n-4)*C(n-2)/(8*n*(2*n-5));
    if n mod 5 = 0 then t1:=t1+(2/5)*C(n/5-1) fi;
    if n mod 2 = 0 then t1:=t1+((3*(n-4)*(n-1))/(16*(n-3)))*C(n/2-1) fi;
    else
    t1 :=  (n-3)^2*(n-4)*C(n-2)/(8*n*(2*n-5));
    if n mod 5 = 0 then t1:=t1+(2/5)*C(n/5-1) fi;
    if n mod 2 = 1 then t1:=t1+((n^2-2*n-11)/(8*(n-4)))*C((n-3)/2) fi;
    fi;
    t1; end;
    [seq(T32(n),n=5..40)];
  • Mathematica
    c = CatalanNumber;
    T32[n_] := Module[{t1}, If[EvenQ[n], t1 = (n-3)^2*(n-4)*c[n-2]/(8*n*(2*n - 5)); If[Mod[n, 5] == 0, t1 = t1 + (2/5)*c[n/5-1]]; If[EvenQ[n], t1 = t1 + ((3*(n-4)*(n-1))/(16*(n-3)))*c[n/2-1]], t1 = (n-3)^2*(n-4)*c[n-2]/(8*n *(2*n - 5)); If[Mod[n, 5] == 0, t1 = t1 + (2/5) * c[n/5-1]]; If[OddQ[n], t1 = t1 + ((n^2 - 2*n - 11)/(8*(n-4)))*c[(n-3)/2]]]; t1];
    Table[T32[n], {n, 5, 40}] (* Jean-François Alcover, Dec 11 2017, translated from Maple *)
  • PARI
    \\ See A295419 for DissectionsModDihedral()
    { my(v=DissectionsModDihedral(apply(i->if(i>=3&&i<=5, y^(i-3) + O(y^3)), [1..30]))); apply(p->polcoeff(p, 2), v[5..#v]) } \\ Andrew Howroyd, Nov 24 2017

Formula

See Maple program.

Extensions

Entry revised (following Bowman and Regev) by N. J. A. Sloane, Dec 28 2012
Name clarified by Andrew Howroyd, Nov 24 2017

A220881 Number of nonequivalent dissections of an n-gon into n-3 polygons by nonintersecting diagonals up to rotation.

Original entry on oeis.org

1, 1, 4, 12, 43, 143, 504, 1768, 6310, 22610, 81752, 297160, 1086601, 3991995, 14732720, 54587280, 202997670, 757398510, 2834510744, 10637507400, 40023636310, 150946230006, 570534578704, 2160865067312, 8199711378716, 31170212479588, 118686578956272
Offset: 4

Views

Author

N. J. A. Sloane, Dec 28 2012

Keywords

Comments

This is almost identical to A003444, but has a different offset and a more precise definition.
In other words, the number of almost-triangulations of an n-gon modulo the cyclic action.
Equivalently, the number of edges of the (n-3)-dimensional associahedron modulo the cyclic action.
The dissection will always be composed of one quadrilateral and n-4 triangles. - Andrew Howroyd, Nov 25 2017
Also number of necklaces of 2 colors with 2n-4 beads and n black ones. - Wouter Meeussen, Aug 03 2002

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A295633.

Programs

  • Maple
    C:=n->binomial(2*n,n)/(n+1);
    T2:= proc(n) local t1; global C;
    t1 :=  (n-3)*C(n-2)/(2*n);
    if n mod 4 = 0 then t1:=t1+C(n/4-1)/2 fi;
    if n mod 2 = 0 then t1:=t1+C(n/2-1)/4 fi;
    t1; end;
    [seq(T2(n),n=4..40)];
  • Mathematica
    c[n_] := Binomial[2*n, n]/(n+1);
    T2[n_] := Module[{t1}, t1 = (n-3)*c[n-2]/(2*n); If[Mod[n, 4] == 0, t1 = t1 + c[n/4-1]/2]; If[Mod[n, 2] == 0, t1 = t1 + c[n/2-1]/4]; t1];
    Table[T2[n], {n, 4, 40}] (* Jean-François Alcover, Nov 23 2017, translated from Maple *)
    a[n_] := Sum[EulerPhi[d]*Binomial[(2n-4)/d, n/d], {d, Divisors[GCD[2n-4, n] ]}]/(2n-4);
    Array[a, 30, 4] (* Jean-François Alcover, Dec 02 2017, after Andrew Howroyd *)
  • PARI
    a(n) = if(n>=4, sumdiv(gcd(2*n-4, n), d, eulerphi(d)*binomial((2*n-4)/d, n/d))/(2*n-4)) \\ Andrew Howroyd, Nov 25 2017

Formula

a(n) = (1/(2n-4)) Sum_{d |(2n-4, n)} phi(d)*binomial((2n-4)/d, n/d) for n >= 4. - Wouter Meeussen, Aug 03 2002

Extensions

Name clarified by Andrew Howroyd, Nov 25 2017

A072506 Triangle giving T(n,m) = number of necklaces of two colors with 2n beads of which m=1..n are black.

Original entry on oeis.org

1, 1, 2, 1, 3, 4, 1, 4, 7, 10, 1, 5, 12, 22, 26, 1, 6, 19, 43, 66, 80, 1, 7, 26, 73, 143, 217, 246, 1, 8, 35, 116, 273, 504, 715, 810, 1, 9, 46, 172, 476, 1038, 1768, 2438, 2704, 1, 10, 57, 245, 776, 1944, 3876, 6310, 8398, 9252, 1, 11, 70, 335, 1197, 3399, 7752
Offset: 1

Views

Author

Wouter Meeussen, Aug 03 2002

Keywords

Comments

Left half of even rows of triangle A047996 (with the leftmost edge discarded).

Crossrefs

Penultimate entries give binary necklaces of n-1 black beads and n+1 white beads, presumably A007595, antepenultimate entries give binary necklaces of n-2 black beads and n+2 white beads, presumably A003444.

Programs

  • Mathematica
    Table[(Plus@@(EulerPhi[ # ]Binomial[2n/#, m/# ] &)/@Intersection[Divisors[2n], Divisors[m]])/(2n), {n, 13}, {m, n}]

Formula

(1/(2n)) Sum_{d |(2n, m)} phi(d)*binomial(2n/d, m/d)

A132892 Square array T(m,n) read by antidiagonals; T(m,n) is the number of equivalence classes in the set of sequences of n nonnegative integers that sum to m, generated by the equivalence relation defined in the following manner: we write a sequence in the form a[1]0a[2]0...0a[p], where each a[i] is a (possibly empty) sequence of positive integers; two sequences in this form, a[1]0a[2]0...0a[p] and b[1]0b[2]0...0b[q] are said to be equivalent if p=q and b[1],b[2],...,b[q] is a cyclic permutation of a[1],a[2],...a[p].

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 5, 3, 1, 1, 5, 9, 7, 4, 1, 1, 6, 13, 14, 10, 4, 1, 1, 7, 19, 25, 22, 12, 5, 1, 1, 8, 25, 41, 42, 30, 15, 5, 1, 1, 9, 33, 63, 79, 66, 43, 19, 6, 1, 1, 10, 41, 92, 131, 132, 99, 55, 22, 6, 1, 1, 11, 51, 129, 213, 245, 217, 143, 73, 26, 7, 1, 1, 12, 61, 175, 325, 428, 429, 335, 201, 91, 31, 7, 1
Offset: 1

Views

Author

Emeric Deutsch and Ira M. Gessel, Oct 02 2007

Keywords

Comments

T(n,n) = A000108(n) (the Catalan numbers; see R. P. Stanley, Catalan addendum, problem starting "Equivalence classes of the equivalence relation ..."). T(m,m+1) = A007595(m+1); T(m,m+2) = A003441(m+1); T(m,m+3) = A003444(m+3); T(n+2,n) = A001453(n+1) (Catalan numbers - 1); T(m,1)=1; T(m,2)=m; T(m,3) = A080827(m) = A099392(m+1); T(m,4) = A004006(m).

Examples

			T(2,4) = 3 because we have {2000, 0200, 0020, 0002}, {1100, 0110, 0011} and {1010, 0101, 1001}.
T(4,2) = 4 because we have {40, 04}, {31}, {13} and {22}.
The square array starts:
  1....1.....1.....1......1.....1.....1...
  1....2.....3.....3......4.....4.....5...
  1....3.....5.....7.....10....12....15...
  1....4.....9....14.....22....30....43...
  1....5....13....25.....42....66....99...
		

Crossrefs

Programs

  • Maple
    with(numtheory): T:=proc(m,n) local r, div, N: r:=igcd(m,n+1): div:=divisors(r): N:=nops(div): (sum(phi(div[j])*(binomial((m+n+1)/div[j]-1,(n+1)/div[j]-1) -binomial(m/div[j]-1,(n+1)/div[j]-1)),j=1..N))/(n+1) end proc: for m to 12 do seq(T(m, n),n=1..12) end do; # yields the upper left 12 by 12 block of the infinite matrix T(m,n)
    # second Maple program:
    T:= proc(m, n) uses numtheory; (C-> add(phi(d)*(C((m+n+1)/d-1, (n+1)/d-1)
          -C(m/d-1, (n+1)/d-1))/(n+1), d=divisors(igcd(m, n+1))))(binomial)
        end:
    seq(seq(T(1+d-n, n), n=1..d), d=1..14);  # Alois P. Heinz, Jan 28 2025
  • Mathematica
    T[m_, n_] := Module[{r, div, N}, r = GCD[m, n + 1]; div = Divisors[r]; N = Length[div]; (Sum[EulerPhi[div[[j]]]*(Binomial[(m + n + 1)/div[[j]] - 1, (n + 1)/div[[j]] - 1] - Binomial[m/div[[j]] - 1, (n + 1)/div[[j]] - 1]), {j, 1, N}])/(n + 1)];
    Table[T[m - n + 1, n], {m, 1, 13}, {n, 1, m}] // Flatten (* Jean-François Alcover, Sep 01 2024, after Maple program *)

Formula

T(m,n) = Sum_{d | gcd(m,n+1)} phi(d)*(C((m+n+1)/d-1, (n+1)/d-1) - C(m/d-1, (n+1)/d-1))/(n+1). [corrected by Jason Yuen, Jan 28 2025]

A220882 Number of (n - 6)-dissections of an n-gon (equivalently, the number of three-dimensional faces of the (n-3)-dimensional associahedron) modulo the cyclic action.

Original entry on oeis.org

1, 2, 16, 93, 505, 2548, 12400, 58140, 266550, 1198564, 5312032, 23263695, 100910001, 434217000, 1855972096, 7887862224, 33359979546, 140492933100, 589495272736, 2465455090098, 10281760786682, 42768958597992, 177499631598976, 735146520745000, 3039095720959424, 12542491305496152
Offset: 6

Views

Author

N. J. A. Sloane, Dec 28 2012

Keywords

Crossrefs

Programs

  • Maple
    C:=n->binomial(2*n,n)/(n+1);
    T4:=proc(n) local t1; global C;
    t1 :=  (((n-3)*(n-4)^2*(n-5))/(24*n*(2*n-5)))*C(n-2);
    if n mod 2 = 0 then t1:=t1+((n-4)^2/(4*n))*C(n/2-2) fi;
    if n mod 3 = 0 then t1:=t1+((n-3)/9)*C(n/3-1) fi;
    if n mod 6 = 0 then t1:=t1+C(n/6-1)/3 fi;
    t1; end;
    [seq(T4(n),n=6..40)];
  • Mathematica
    c = CatalanNumber;
    T4[n_] := Module[{t1},
    t1 = (((n - 3)*(n - 4)^2*(n - 5))/(24*n*(2*n - 5)))*c[n - 2];
    If[Mod[n, 2] == 0, t1 = t1 + ((n - 4)^2/(4*n))*c[n/2 - 2]];
    If[Mod[n, 3] == 0, t1 = t1 + ((n - 3)/9)*c[n/3 - 1]];
    If[Mod[n, 6] == 0, t1 = t1 + c[n/6 - 1]/3]; t1];
    Table[T4[n], {n, 6, 40}] (* Jean-François Alcover, Dec 02 2017, from Maple *)

Formula

See Maple code.
Showing 1-7 of 7 results.