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

A178833 Partial sums of "Half-Catalan numbers" A000992.

Original entry on oeis.org

1, 2, 3, 5, 8, 14, 25, 49, 96, 199, 413, 894, 1924, 4261, 9392, 21205, 47534, 108492, 246313, 568003, 1302431, 3024429, 6990985, 16343338, 38026783, 89322813, 208986625, 493184761, 1159317065, 2745547588, 6480141829, 15399987104, 36475269692, 86916706534, 206503331542
Offset: 1

Views

Author

Jonathan Vos Post, Jan 01 2011

Keywords

Comments

The subsequence of primes begins: 2, 3, 5, 199, 4261, 493184761.
The subsequence of perfect powers begins: 1, 8, 25, 49.

Examples

			A000992 starts with 1, 1, 1, 2, 3, ... giving partial sums 1, 2, 3, 5, 8 ...
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, 1,
          add(b(j)*b(n-j), j=1..n/2))
        end:
    a:= proc(n) option remember; `if`(n<1, 0, b(n)+a(n-1)) end:
    seq(a(n), n=1..42);  # Alois P. Heinz, Nov 04 2024
  • PARI
    lista(nn) = for (k=1, nn, print1(vecsum(A000992_list(k)), ", ")); \\ Michel Marcus, Feb 16 2015

Formula

a(n) = Sum_{i=1..n} A000992(i).

A196545 Number of weakly ordered plane trees with n leaves.

Original entry on oeis.org

1, 1, 2, 5, 12, 34, 92, 277, 806, 2500, 7578, 24198, 75370, 243800, 776494, 2545777, 8223352, 27221690, 88984144, 296856400, 979829772, 3287985078, 10934749788, 36912408342, 123519937044, 418650924886, 1408867195252, 4794243983204, 16205061000480
Offset: 1

Views

Author

Gus Wiseman, Oct 03 2011

Keywords

Comments

A weakly ordered plane tree (p-tree) of weight n > 1 is a sequence (t_1, t_2, ..., t_k) where k > 1 and for some integer partition y of length k and sum n, the term t_i is a p-tree of weight y_i, for 1 <= i <= k. For n = 1, the only p-tree is a single node.
This definition precludes nodes with only one branch, and non-leaf nodes have weight 0. If the above is changed so that k >= 1 and y is partition of n-1, we get the trees counted by A093637. Binary p-trees are counted by A000992.

Examples

			Let o denote a single node. The 12 p-trees of weight 5 are: ((((oo)o)o)o), (((ooo)o)o), (((oo)(oo))o), (((oo)oo)o), ((oooo)o), (((oo)o)(oo)), ((ooo)(oo)), (((oo)o)oo), ((ooo)oo), ((oo)(oo)o), ((oo)ooo), (ooooo).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember;
          `if`(i>n, 0, a(i)*`if`(i=n, 1, b(n-i, i)))+`if`(i>1, b(n, i-1), 0)
        end:
    a:= proc(n) option remember;
          `if`(n=1, 1, add(a(k)*b(n-k, min(n-k, k)), k=1..n-1))
        end:
    seq(a(n), n=1..40);  # Alois P. Heinz, Jul 06 2012
  • Mathematica
    PTNum[n_] := PTNum[n] =
        If[n === 1, 1, Plus @@ Function[y,
        Times @@ PTNum /@ y] /@ Rest[Partitions[n]]]; Array[PTNum, 20]
    (* Second program: *)
    b[n_, i_] := b[n, i] = If[i>n, 0, a[i]*If[i == n, 1, b[n-i, i]]] + If[i>1, b[n, i-1], 0];
    a[n_] := a[n] = If[n == 1, 1, Sum[a[k]*b[n-k, Min[n-k, k] ], {k, 1, n-1}]];
    Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Nov 05 2015, after Alois P. Heinz *)
  • PARI
    seq(n)={my(v=vector(n)); v[1] = 1; for(n=2, n, v[n] = polcoef(1/prod(k=1, n-1, 1 - v[k]*x^k + O(x*x^n)), n)); v} \\ Andrew Howroyd, Aug 26 2018
    
  • Sage
    @cached_function
    def A196545(n):
        if n == 1: return 1
        return sum(prod(A196545(t) for t in p) for p in Partitions(n,min_length=2))
    # D. S. McNeil, Oct 03 2011

Formula

a(1) = 1; for n > 1, a(n) = Sum_{y} Product_{i} a(y_i) where the sum is over all partitions of n with at least two parts.
The generating function is characterized by the formal equation 1 + 2*S(x) = x + 1/P(x) where S(x) = Sum_{n>0} a(n)*x^n and P(x) = Product_{n>0} (1 - a(n)*x^n) are the formal infinite series and formal infinite product with a(n) as coefficients and roots respectively.

A201204 Half-convolution of Catalan sequence A000108 with itself.

Original entry on oeis.org

1, 1, 3, 7, 23, 66, 227, 715, 2529, 8398, 30275, 104006, 380162, 1337220, 4939443, 17678835, 65844845, 238819350, 895451117, 3282060210, 12374186318, 45741281820, 173257703723, 644952073662, 2452607696798, 9183676536076, 35042725663002, 131873975875180, 504697422982484, 1907493251046152
Offset: 0

Views

Author

Wolfdieter Lang, Jan 02 2012

Keywords

Comments

In general the half-convolution of a sequence {b(n)}_0^infty with itself is defined by chat(n):=sum(b(k)*b(n-k), k=0..floor(n/2)), n>=0. The o.g.f. of the sequence {chat(n)} is obtained from the bisection 2*chat(2*k) - b(k)^2 = c(2*k), k>=0, with the ordinary convolution c(n):=sum(b(k)*b(n-k),k=0..n), n>=0, and 2*chat(2*k+1) = c(2*k+1), k>=0. This leads to the o.g.f.s for the corresponding even (e) and odd (o) parts:
2*Chate(x) - B2(x) = Ce(x) and 2*Chato(x) = Co(x), where Chate(x):= sum(chat(2*k)*x^k,k=0..infty), Chato(x):= sum(chat(2*k+1)*x^k,k=0..infty), B2(x) := sum(b(k)^2*x^k, k=0..infty), Ce(x) := sum(c(2*k)*x^k, k=0..infty) and Co(x) := sum(c(2*k+1)*x^k, k=0..infty). Thus Chate(x)=(Ce(x) + B2(x))/2 and Chato(x)=Co(x)/2. Expressing this in terms of C(x), the o.g.f. of {c(n)}, and B2(x) leads to the result: Chat(x)= (C(x) + B2(x^2))/2.
In the Catalan case b(n)=A000108(n), c(n)=b(n+1), C(x)= (cata(x)+1)/x, with the o.g.f. of A000108 cata(x)=(1-sqrt(1-4*x))/(2*x), and B2(x) is found under A001246 to be (-1 + hypergeom([-1/2,-1/2],[1],16*x))/(4*x). This produces the o.g.f. given in the formula section.
This computation was motivated by a question about the o.g.f. of A000992 ("half-Catalan numbers"). Note, however, that this sequence is not the half-convolution of the Catalan numbers presented here.
Apparently the number of hills to the left of or at the midpoint in all Dyck paths of semilength n+1. [David Scambler, Apr 30 2013]

Crossrefs

A000108, bisection: A201205 and A065097.

Programs

  • Maple
    C:= n -> binomial(2*n,n)/(n+1):
    A:= n -> add(C(k)*C(n-k),k=0..floor(n/2));
    seq(A(i),i=1..100); # Robert Israel, Jun 06 2014
  • Mathematica
    Table[Sum[CatalanNumber[k]CatalanNumber[n-k],{k,0,Floor[n/2]}],{n,0,30}] (* Harvey P. Dale, Jun 12 2012 *)
    Table[CatalanNumber[n + 1]/2 + 2^(2 n + 1) Binomial[1/2, n/2 + 1]^2, {n, 0, 30}] (* Vladimir Reshetnikov, Oct 03 2016 *)

Formula

a(n) = sum(Catalan(k)*Catalan(n-k),k=0..floor(n/2)), n>=0, with Catalan(n)=A000108(n).
O.g.f.: G(x)=(catalan(x)-1)/(2*x)+(-1+hypergeom([-1/2,-1/2],[1],16*x^2))/(8*x^2), with the o.g.f. catalan(x) of the Catalan numbers (see also the comment section).
a(n) ~ 2^(2*n+1) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Oct 15 2014
a(n) = A000108(n+1)/2 + 2^(2*n+1) * binomial(1/2, n/2+1)^2. - Vladimir Reshetnikov, Oct 03 2016
D-finite with recurrence: (n+1)*(n+2)^2*a(n) +6*(n-2)*(n+1)^2*a(n-1) +4*(-16*n^3+25*n^2+4*n-4)*a(n-2) +16*(-4*n^3+25*n^2-56*n+41)*a(n-3) +192*(4*n-7)*(n-3)^2*a(n-4) -256*(2*n-7)*(n-4)^2*a(n-5)=0. - R. J. Mathar, Feb 21 2020

A300443 Number of binary enriched p-trees of weight n.

Original entry on oeis.org

1, 1, 2, 3, 8, 15, 41, 96, 288, 724, 2142, 5838, 17720, 49871, 151846, 440915, 1363821, 4019460, 12460721, 37374098, 116809752, 353904962, 1109745666, 3396806188, 10712261952, 33006706419, 104357272687, 323794643722, 1027723460639, 3204413808420, 10193485256501
Offset: 0

Views

Author

Gus Wiseman, Mar 05 2018

Keywords

Comments

A binary enriched p-tree of weight n is either a single node of weight n, or an ordered pair of binary enriched p-trees with weakly decreasing weights summing to n.

Examples

			The a(4) = 8 binary enriched p-trees: 4, (31), (22), ((21)1), ((11)2), (2(11)), (((11)1)1), ((11)(11)).
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
          1+add(a(j)*a(n-j), j=1..n/2)
        end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Mar 06 2018
  • Mathematica
    j[n_]:=j[n]=1+Sum[Times@@j/@y,{y,Select[IntegerPartitions[n],Length[#]===2&]}];
    Array[j,40]
    (* Second program: *)
    a[n_] := a[n] = 1 + Sum[a[j]*a[n-j], {j, 1, n/2}];
    a /@ Range[0, 40] (* Jean-François Alcover, May 12 2021, after Alois P. Heinz *)
  • PARI
    seq(n)={my(v=vector(n)); for(n=1, n, v[n] = 1 + sum(k=1, n\2, v[k]*v[n-k])); concat([1], v)} \\ Andrew Howroyd, Aug 26 2018

Formula

a(n) = 1 + Sum_{x + y = n, 0 < x <= y < n} a(x) * a(y).

A300442 Number of binary strict trees of weight n.

Original entry on oeis.org

1, 1, 1, 2, 3, 6, 10, 23, 46, 108, 231, 561, 1285, 3139, 7348, 18265, 43907, 109887, 267582, 675866, 1669909, 4238462, 10555192, 26955062, 67706032, 173591181, 438555624, 1129088048, 2869732770, 7410059898, 18911818801, 48986728672, 125562853003, 326011708368
Offset: 0

Views

Author

Gus Wiseman, Mar 05 2018

Keywords

Comments

A binary strict tree of weight n > 0 is either a single node of weight n, or an ordered pair of binary strict trees with strictly decreasing weights summing to n.

Examples

			The a(5) = 6 binary strict trees: 5, (41), (32), ((31)1), ((21)2), (((21)1)1).
The a(6) = 10 binary strict trees:
  6,
  (51), (42),
  ((41)1), ((32)1), ((31)2),
  (((31)1)1), (((21)2)1), (((21)1)2),
  ((((21)1)1)1).
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
          1+add(a(j)*a(n-j), j=1..(n-1)/2)
        end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Mar 06 2018
  • Mathematica
    k[n_]:=k[n]=1+Sum[Times@@k/@y,{y,Select[IntegerPartitions[n],Length[#]===2&&UnsameQ@@#&]}];
    Array[k,40]
    (* Second program: *)
    a[n_] := a[n] = 1 + Sum[a[j]*a[n - j], {j, 1, (n - 1)/2}];
    a /@ Range[0, 40] (* Jean-François Alcover, May 13 2021, after Alois P. Heinz *)
  • PARI
    seq(n)={my(v=vector(n)); for(n=1, n, v[n] = 1 + sum(k=1, (n-1)\2, v[k]*v[n-k])); concat([1], v)} \\ Andrew Howroyd, Aug 25 2018

Formula

a(n) = 1 + Sum_{x + y = n, 0 < x < y < n} a(x) * a(y).

A301368 Regular triangle where T(n,k) is the number of binary enriched p-trees of weight n with k leaves.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 2, 4, 5, 3, 1, 3, 7, 12, 12, 6, 1, 3, 9, 19, 28, 25, 11, 1, 4, 14, 36, 65, 81, 63, 24, 1, 4, 16, 48, 107, 172, 193, 136, 47, 1, 5, 22, 75, 192, 369, 522, 522, 331, 103, 1, 5, 25, 96, 284, 643, 1108, 1420, 1292, 750, 214, 1, 6
Offset: 1

Views

Author

Gus Wiseman, Mar 19 2018

Keywords

Comments

A binary enriched p-tree of weight n is either a single node of weight n, or an ordered pair of binary enriched p-trees with weakly decreasing weights summing to n.

Examples

			Triangle begins:
  1
  1   1
  1   1   1
  1   2   3   2
  1   2   4   5   3
  1   3   7  12  12   6
  1   3   9  19  28  25  11
  1   4  14  36  65  81  63  24
  1   4  16  48 107 172 193 136  47
  1   5  22  75 192 369 522 522 331 103
  ...
The T(6,3) = 7 binary enriched p-trees: ((41)1), ((32)1), (4(11)), ((31)2), ((22)2), (3(21)), ((21)3).
		

Crossrefs

Programs

  • Mathematica
    bintrees[n_]:=Prepend[Join@@Table[Tuples[bintrees/@ptn],{ptn,Select[IntegerPartitions[n],Length[#]===2&]}],n];
    Table[Length[Select[bintrees[n],Count[#,_Integer,{-1}]===k&]],{n,13},{k,n}]
  • PARI
    A(n)={my(v=vector(n)); for(n=1, n, v[n] = y + sum(k=1, n\2, v[k]*v[n-k])); apply(p->Vecrev(p/y), v)}
    { my(T=A(10)); for(n=1, #T, print(T[n])) } \\ Andrew Howroyd, Aug 26 2018

A327643 Number of refinement sequences n -> ... -> {1}^n, where in each step one part is replaced by a partition of itself into two smaller parts (in weakly decreasing order).

Original entry on oeis.org

1, 1, 1, 3, 6, 24, 84, 498, 2220, 15108, 92328, 773580, 5636460, 53563476, 471562512, 5270698716, 52117937052, 637276396764, 7317811499736, 100453675122444, 1276319138168796, 19048874583061716, 270233458572751440, 4442429353548965628, 68384217440167826412
Offset: 1

Views

Author

Alois P. Heinz, Sep 20 2019

Keywords

Comments

Number of proper (n-1)-times partitions of n, cf. A327639.
Might be called "Half-Factorial numbers" analog to the "Half-Catalan numbers" (A000992).
The recursion formula is a special case of the formula given in A327729.
a(n+1)/(n*a(n)) tends to 0.67617164... - Vaclav Kotesovec, Apr 28 2020

Examples

			a(1) = 1:
  1
a(2) = 1:
  2 -> 11
a(3) = 1:
  3 -> 21 -> 111
a(4) = 3:
  4 -> 31 -> 211 -> 1111
  4 -> 22 -> 112 -> 1111
  4 -> 22 -> 211 -> 1111
a(5) = 6:
  5 -> 41 -> 311 -> 2111 -> 11111
  5 -> 41 -> 221 -> 1121 -> 11111
  5 -> 41 -> 221 -> 2111 -> 11111
  5 -> 32 -> 212 -> 1112 -> 11111
  5 -> 32 -> 212 -> 2111 -> 11111
  5 -> 32 -> 311 -> 2111 -> 11111
		

Crossrefs

Cf. A000142, A000992, A002846 (only one part of each size is replaceable), A327631, A327639, A327697, A327698, A327699, A327702, A327729.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n=0 or k=0, 1, `if`(i>1,
          b(n, i-1, k), 0) +b(i$2, k-1)*b(n-i, min(n-i, i), k))
        end:
    a:= n-> add(b(n$2, i)*(-1)^(n-1-i)*binomial(n-1, i), i=0..n-1):
    seq(a(n), n=1..29);
    # second Maple program:
    a:= proc(n) option remember; `if`(n=1, 1,
          add(a(j)*a(n-j)*binomial(n-2, j-1), j=1..n/2))
        end:
    seq(a(n), n=1..29);
  • Mathematica
    a[n_] := a[n] = Sum[Binomial[n-2, j-1] a[j] a[n-j], {j, n/2}]; a[1] = 1;
    Array[a, 25] (* Jean-François Alcover, Apr 28 2020 *)

Formula

a(n) = Sum_{j=1..floor(n/2)} C(n-2,j-1) a(j)*a(n-j) for n > 1, a(1) = 1.
a(n) = A327639(n,n-1) = A327631(n,n-1)/n.

A300866 Signed recurrence over binary strict trees: a(n) = 1 - Sum_{x + y = n, 0 < x < y < n} a(x) * a(y).

Original entry on oeis.org

1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, -1, 1, 1, -2, 3, -1, -3, 8, -8, 1, 14, -26, 22, 10, -59, 90, -52, -74, 238, -291, 80, 417, -930, 915, 124, -1991, 3483, -2533, -2148, 9011, -12596, 5754, 14350, -37975, 42735, -4046, -77924, 154374, -133903, -56529, 376844, -591197, 355941, 522978, -1706239
Offset: 0

Views

Author

Gus Wiseman, Mar 13 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=1-Sum[a[k]*a[n-k],{k,1,(n-1)/2}];
    Array[a,40]
  • PARI
    seq(n)={my(v=vector(n)); for(n=1, n, v[n] = 1 - sum(k=1, (n-1)\2, v[k]*v[n-k])); concat([1], v)} \\ Andrew Howroyd, Aug 27 2018

A030036 a(n+1) = Sum_{k=0..floor(n/5)} a(k) * a(n-k).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 3, 5, 8, 13, 26, 47, 86, 159, 292, 584, 1121, 2156, 4153, 8014, 16028, 31472, 61823, 121490, 238827, 477654, 947294, 1878560, 3725648, 7389473, 14900436, 29796719, 59593438, 119178862, 238341696, 482287600, 970054641, 1951222247, 3924973230
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • PARI
    lista(nn) = {my(v=vector(nn+2, i, 1)); for(n=3, nn, v[n+2]=sum(k=1, 1+n\5, v[k]*v[n+2-k])); v; } \\ Jinyuan Wang, Mar 18 2020

Extensions

More terms from Jinyuan Wang, Mar 18 2020

A300863 Signed recurrence over enriched p-trees: a(n) = (-1)^(n - 1) + Sum_{y1 + ... + yk = n, y1 >= ... >= yk > 0, k > 1} a(y1) * ... * a(yk).

Original entry on oeis.org

1, 0, 2, 2, 6, 14, 34, 82, 214, 566, 1482, 4058, 10950, 30406, 83786, 235714, 658286, 1874254, 5293674, 15189810, 43312542, 125075238, 359185586, 1043712922, 3015569582, 8800146182, 25565402802, 74918274562, 218572345718, 642783954238, 1882606578002
Offset: 1

Views

Author

Gus Wiseman, Mar 13 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=(-1)^(n-1)+Sum[Times@@a/@y,{y,Select[IntegerPartitions[n],Length[#]>1&]}];
    Array[a,40]

Formula

O.g.f.: (-1/(1+x) + Product 1/(1-a(n)x^n))/2.
Showing 1-10 of 33 results. Next