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

A005264 Number of labeled rooted Greg trees with n nodes.

Original entry on oeis.org

1, 3, 22, 262, 4336, 91984, 2381408, 72800928, 2566606784, 102515201984, 4575271116032, 225649908491264, 12187240730230528, 715392567595403520, 45349581052869924352, 3087516727770990992896, 224691760916830871873536
Offset: 1

Views

Author

Keywords

Comments

A rooted Greg tree can be described as a rooted tree with 2-colored nodes where only the black nodes are counted and labeled and the white nodes have at least 2 children. - Christian G. Bower, Nov 15 1999

Examples

			G.f. = x + 3*x^2 + 22*x^3 + 262*x^4 + 4336*x^5 + 91984*x^6 + 2381408*x^7 + ...
		

References

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

Crossrefs

Inverse Stirling transform of A005172 (hence corrected and extended). - John W. Layman

Programs

  • Maple
    T := proc(n,k) option remember; if k=0 and (n=0 or n=1) then return(1) fi; if k<0 or k>n then return(0) fi;
    (n-1)*T(n-1,k-1)+(3*n-k-4)*T(n-1,k)-(k+1)*T(n-1,k+1) end:
    A005264 := proc(n) add(T(n,k)*(-1)^k*2^(n-k-1), k=0..n-1) end;
    seq(A005264(n),n=1..17); # Peter Luschny, Nov 10 2012
  • Mathematica
    max = 17; f[x_] := -1/2 - ProductLog[-E^(-1/2)*(x + 1)/2]; Rest[ CoefficientList[ Series[ f[x], {x, 0, max}], x]*Range[0, max]!] (* Jean-François Alcover, May 23 2012, after Peter Bala *)
    a[ n_] := If[ n < 1, 0, n! SeriesCoefficient[ InverseSeries[ Series[ Exp[-x] (1 + 2 x) - 1, {x, 0, n}]], n]]; (* Michael Somos, Jun 07 2012 *)
  • Maxima
    a(n):=if n=1 then 1 else sum((n+k-1)!*sum(1/(k-j)!*sum(1/(l!*(j-l)!)*sum(((-1)^(i+l)*l^i*binomial(l,n+j-i-1)*2^(n+j-i-1))/i!,i,0,n+j-1),l,1,j),j,1,k),k,1,n-1); /* Vladimir Kruchinin, May 04 2012 */
    
  • PARI
    {a(n) = local(A); if( n<1, 0, for( k= 1, n, A += x * O(x^k); A = truncate( (1 + x) * exp(A) - 1 - A) ); n! * polcoeff( A, n))}; /* Michael Somos, Apr 02 2007 */
    
  • PARI
    {a(n) = if( n<1, 0, n! * polcoeff( serreverse( exp( -x + x * O(x^n) ) * (1 + 2*x) - 1), n))}; /* Michael Somos, Mar 26 2011 */
    
  • Sage
    @CachedFunction
    def T(n,k):
        if k==0 and (n==0 or n==1): return 1
        if k<0 or k>n: return 0
        return (n-1)*T(n-1,k-1)+(3*n-k-4)*T(n-1,k)-(k+1)*T(n-1,k+1)
    A005264 = lambda n: add(T(n,k)*(-1)^k*2^(n-k-1) for k in (0..n-1))
    [A005264(n) for n in (1..17)]  # Peter Luschny, Nov 10 2012

Formula

Exponential reversion of A157142 with offset 1. - Michael Somos, Mar 26 2011
The REVEGF transform of the odd numbers [1,3,5,7,9,11,...] is [1, -3, 22, -262, 4336, -91984, 2381408, ...] - N. J. A. Sloane, May 26 2017
E.g.f. A(x) = y satisfies y' = (1 + 2*y) / ((1 - 2*y) * (1 + x)). - Michael Somos, Mar 26 2011
E.g.f. A(x) satisfies (1 + x) * exp(A(x)) = 1 + 2 * A(x).
From Peter Bala, Sep 08 2011: (Start)
A(x) satisfies the separable differential equation A'(x) = exp(A(x))/(1-2*A(x)) with A(0) = 0. Thus the inverse function A^-1(x) = int {t = 0..x} (1-2*t)/exp(t) = exp(-x)*(2*x+1)-1 = x-3*x^2/2!+5*x^3/3!-7*x^4/4!+.... A(x) = -1/2-LambertW(-exp(-1/2)*(x+1)/2).
The expansion of A(x) can be found by inverting the above integral using the method of [Dominici, Theorem 4.1] to arrive at the result a(n) = D^(n-1)(1) evaluated at x = 0, where D denotes the operator g(x) -> d/dx(exp(x)/(1-2*x)*g(x)). Compare with [Dominici, Example 9].
(End)
a(n)=sum(k=1..n-1, (n+k-1)!*sum(j=1..k, 1/(k-j)!*sum(l=1..j, 1/(l!*(j-l)!)* sum(i=0..n+j-1, ((-1)^(i+l)*l^i*binomial(l,n+j-i-1)*2^(n+j-i-1))/i!)))), n>1, a(1)=1. - Vladimir Kruchinin, May 04 2012
Let T(n,k) = 1 if k=0 and (n=0 or n=1); T(n,k) = 0 if k<0 or k>n; and otherwise T(n,k) = (n-1)*T(n-1,k-1)+(3*n-k-4)*T(n-1,k)-(k+1)*T(n-1,k+1). Define polynomials p(n,w) = w^n*sum_{k=0..n-1}(T(n,k)*w^k)/(1+w)^(2*n-1), then a(n) = (-1)^n*p(n,-1/2). - Peter Luschny, Nov 10 2012
a(n) ~ n^(n-1) / (sqrt(2) * exp(n/2) * (2-exp(1/2))^(n-1/2)). - Vaclav Kotesovec, Jul 09 2013
E.g.f.: -W(-(1+x)*exp(-1/2)/2)-1/2 where W is the Lambert W function. - Robert Israel, Mar 28 2017

A005263 Number of labeled Greg trees.

Original entry on oeis.org

1, 1, 1, 4, 32, 396, 6692, 143816, 3756104, 115553024, 4093236352, 164098040448, 7345463787136, 363154251536896, 19653476190481408, 1155636468524067328, 73364615077878838784, 5001199614295920565248, 364363128390631094137856
Offset: 0

Views

Author

Keywords

Comments

A Greg tree can be described as a tree with 2-colored nodes where only the black nodes are counted and labeled and the white nodes are of degree at least 3.

References

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

Crossrefs

Programs

  • Maple
    E:= 1/4 -LambertW(-(1+x)*exp(-1/2)/2)^2 - 2*LambertW(-(1+x)*exp(-1/2)/2):
    S:= series(E,x,21):
    seq(coeff(S,x,j)*j!, j=0..20); # Robert Israel, Mar 28 2017
  • Mathematica
    max = 18; b[x] := -1/2 - ProductLog[-Exp[-1/2]*(x+1)/2]; f[x_] := Sum[c[k]*x^k, {k, 0, max}]; sol = SolveAlways[ Normal[ Series[f[x] - (1 + b[x] - b[x]^2), {x, 0, max}]] == 0, x]; First[Table[c[k], {k, 0, max}] /. sol]*Range[0, max]! (* Jean-François Alcover, May 21 2012, from e.g.f. *)
    a[ n_] := If[ n < 1, Boole[n == 0], n! SeriesCoefficient[ With[ {B =      InverseSeries[ Series[ Exp[-x] (1 + 2 x) - 1, {x, 0, n}]]}, B - B^2], n]] (* Michael Somos, Jun 07 2012 *)
  • PARI
    {a(n) = local(A); if( n<1, n==0, for( k=1, n, A += x * O(x^k); A = truncate( (1 + x) * exp(A) - 1 - A) ); A += x * O(x^n); A -= A^2; n! * polcoeff( A, n))} /* Michael Somos, Apr 02 2007 */

Formula

E.g.f.: 1 + B(x) - B(x)^2 where B(x) is e.g.f. of A005264.
a(n) ~ n^(n-2) / (sqrt(2) * exp(n/2) * (2-exp(1/2))^(n-3/2)). - Vaclav Kotesovec, Jul 09 2013
E.g.f.: 1/4 - W(-(1+x)*exp(-1/2)/2)^2 - 2*W(-(1+x)*exp(-1/2)/2) where W is the Lambert W function. - Robert Israel, Mar 28 2017

Extensions

More terms, formula and comment from Christian G. Bower, Nov 15 1999

A048159 Triangle giving a(n,k) = number of (n,k) labeled Greg trees (n >= 2, 0 <= k <= n-2).

Original entry on oeis.org

1, 3, 1, 16, 13, 3, 125, 171, 85, 15, 1296, 2551, 2005, 735, 105, 16807, 43653, 47586, 26950, 7875, 945, 262144, 850809, 1195383, 924238, 412650, 100485, 10395, 4782969, 18689527, 32291463, 31818045, 19235755, 7113645, 1486485, 135135
Offset: 2

Views

Author

Keywords

Comments

An (n,k) Greg tree can be described as a tree with n black nodes and k white nodes where only the black nodes are labeled and the white nodes are of degree at least 3.
Row sums give A005263.

Examples

			Triangle begins
    1;
    3,   1;
   16,  13,   3;
  125, 171,  85,  15;
  ...
		

Crossrefs

Programs

  • Mathematica
    a[n_, 0] := n^(n-2); a[n_ /; n >= 2, k_] /; 0 <= k <= n-2 := a[n, k] = (n+k-3)*a[n-1, k-1] + (2*n+2*k-3)*a[n-1, k] + (k+1)*a[n-1, k+1]; a[n_, k_] = 0; Table[a[n, k], {n, 2, 9}, {k, 0, n-2}] // Flatten (* Jean-François Alcover, Oct 03 2013 *)

Formula

a(n, 0) = n^(n-2), a(n, k) = (n+k-3)*a(n-1, k-1) + (2n+2k-3)*a(n-1, k) + (k+1)*a(n-1, k+1).

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 07 2000

A052300 Number of rooted Greg trees.

Original entry on oeis.org

1, 2, 6, 21, 78, 313, 1306, 5653, 25088, 113685, 523522, 2443590, 11533010, 54949539, 263933658, 1276652682, 6213207330, 30402727854, 149486487326, 738184395770, 3659440942282, 18205043615467, 90856842218506, 454770531433586, 2282393627458496, 11483114908752959
Offset: 1

Views

Author

Christian G. Bower, Nov 15 1999

Keywords

Comments

A rooted Greg tree can be described as a rooted tree with 2-colored nodes where only the black nodes are counted and the white nodes have at least 2 children.

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(binomial(a(i)+j-1, j)*b(n-i*j, i-1), j=0..n/i)))
        end:
    a:= n-> `if`(n<1, 0, b(n-1$2)+b(n, n-1)):
    seq(a(n), n=1..40);  # Alois P. Heinz, Jun 22 2018
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, Sum[Binomial[a[i] + j - 1, j] b[n - i j, i - 1], {j, 0, n/i}]]];
    a[n_] := If[n < 1, 0, b[n - 1, n - 1] + b[n, n - 1]];
    a /@ Range[1, 40] (* Jean-François Alcover, Oct 02 2019, after Alois P. Heinz *)

Formula

Satisfies a = EULER(a) + SHIFT_RIGHT(EULER(a)) - a.
a(n) ~ c * d^n / n^(3/2), where d = 5.33997181362574740496306748840603859910694551382103293340704... and c = 0.18146848896221859476228524468003196434835879494225205... - Vaclav Kotesovec, Jun 11 2021

A052303 Number of asymmetric Greg trees.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 1, 4, 12, 42, 137, 452, 1491, 4994, 16831, 57408, 197400, 685008, 2395310, 8437830, 29917709, 106724174, 382807427, 1380058180, 4998370015, 18181067670, 66393725289, 243347195594, 894959868983, 3301849331598, 12217869541117, 45335177297876
Offset: 0

Views

Author

Christian G. Bower, Nov 15 1999

Keywords

Comments

A Greg tree can be described as a tree with 2-colored nodes where only the black nodes are counted and the white nodes are of degree at least 3.

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(binomial(g(i), j)*b(n-i*j, i-1), j=0..n/i)))
        end:
    g:= n-> `if`(n<1, 0, b(n-1$2)+b(n, n-1)) :
    a:= n-> `if`(n=0, 1, g(n)-add(g(j)*g(n-j), j=0..n)):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jun 22 2018
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, Sum[Binomial[g[i], j] b[n - i j, i - 1], {j, 0, n/i}]]];
    g[n_] := If[n < 1, 0, b[n - 1, n - 1] + b[n, n - 1]];
    a[n_] := If[n == 0, 1, g[n] - Sum[g[j] g[n - j], {j, 0, n}]];
    a /@ Range[0, 40] (* Jean-François Alcover, Apr 28 2020, after Alois P. Heinz *)

Formula

G.f.: 1+B(x)-B(x)^2 where B(x) is g.f. of A052301.

A052301 Number of asymmetric rooted Greg trees.

Original entry on oeis.org

1, 1, 2, 5, 14, 43, 138, 455, 1540, 5305, 18546, 65616, 234546, 845683, 3072350, 11235393, 41326470, 152793376, 567518950, 2116666670, 7924062430, 29765741831, 112157686170, 423809991041, 1605622028100, 6097575361683, 23207825593664, 88512641860558
Offset: 1

Views

Author

Christian G. Bower, Nov 15 1999

Keywords

Comments

A rooted Greg tree can be described as a rooted tree with 2-colored nodes where only the black nodes are counted and the white nodes have at least 2 children.

Crossrefs

Essentially the same as A031148. Cf. A005263, A005264, A048159, A048160, A052300-A052303.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(binomial(a(i), j)*b(n-i*j, i-1), j=0..n/i)))
        end:
    a:= n-> `if`(n<1, 1, b(n-1$2)) +b(n, n-1):
    seq(a(n), n=1..40);  # Alois P. Heinz, Jul 06 2014
  • Mathematica
    b[n_, i_] := b[n, i] = If[n==0, 1, If[i<1, 0, Sum[Binomial[a[i], j]*b[n - i*j, i-1], {j, 0, n/i}]]];
    a[n_] := If[n<1, 1, b[n-1, n-1]] + b[n, n-1];
    Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Mar 01 2016, after Alois P. Heinz *)

Formula

Satisfies a = WEIGH(a) + SHIFT_RIGHT(WEIGH(a)) - a.
a(n) ~ c * d^n / n^(3/2), where d = 4.0278584853545190803008179085023154..., c = 0.14959176868229550510957320468... . - Vaclav Kotesovec, Sep 12 2014

A054589 Table related to labeled rooted trees, cycles and binary trees.

Original entry on oeis.org

1, 1, 1, 2, 4, 3, 6, 18, 25, 15, 24, 96, 190, 210, 105, 120, 600, 1526, 2380, 2205, 945, 720, 4320, 13356, 26488, 34650, 27720, 10395, 5040, 35280, 128052, 305620, 507430, 575190, 405405, 135135
Offset: 1

Views

Author

F. Chapoton, Apr 14 2000

Keywords

Comments

The left column is (n-1)!, the right column is (2n-3)!!, the total of each row is n^(n-1).
Constant terms of polynomials related to Ramanujan psi polynomials (see Zeng reference).
From Peter Bala, Sep 29 2011: (Start)
Differentiating n times the Lambert function W(x) = Sum_{n>=1} n^(n-1)*x^n/n! with respect to x yields (d/dx)^n W(x) = exp(n*W(x))/(1-W(x))^n*R(n,1/(1-W(x))), where R(n,x) is the n-th row polynomial of this triangle. The first few values are R(1,x) = 1, R(2,x) = 1+x, R(3,x) = 2+4*x+3*x^2. The Ramanujan polynomials R(n,x) are strongly x-log-convex [Chen et al.].
Shor and Dumont-Ramamonjisoa have proved independently that the coefficient of x^k in R(n,x) counts rooted labeled trees on n vertices with k improper edges. Drake, Example 1.7.3, gives another combinatorial interpretation for this triangle as counting a family of labeled trees.
(End)

Examples

			Triangle begins:
  {1},
  {1,  1},
  {2,  4,  3},
  {6, 18, 25, 15},
  ...
		

Crossrefs

Programs

  • Mathematica
    p[1] = 1; p[n_] := p[n] = Expand[x^2*D[p[n-1], x] + (n-1)(1+x)p[n-1]]; Flatten[ Table[ CoefficientList[ p[n], x], {n, 1, 8}]] (* Jean-François Alcover, Jul 22 2011 *)
    Clear[a];
    a[1, 0] = 1;
    a[n_, k_] /; k < 0 || k >= n := 0
    a[n_, k_] /; 0 <= k <= n - 1 :=
    a[n, k] = (n - 1) a[n - 1, k] + (n + k - 2) a[n - 1, k - 1]
    Table[a[n, k], {n, 20}, {k, 0, n - 1}] (* David Callan, Oct 14 2012 *)

Formula

The polynomials p_n = Sum a[n, k]x^k satisfy p_1=1 and p_(n+1) = x*x*dp_n/dx+n*(1+x)*p_n.
From Peter Bala, Sep 29 2011: (Start)
E.g.f.: series reversion with respect to x of (1-t+(t-1+x*t)*exp(-x)) = x + (1+t)*x^2/2! + (2+4*t+3*t^2)*x^3/3! + ....
The sequence of shifted row polynomials {p_n(1+t)}n>=1 begins [1,2+t,9+10*t+3*t^2,...]. These are the row polynomials of A048160.
(End)
Let f(x) = exp(x)/(1-t*x). The e.g.f. A(x,t) = x + (1+t)*x^2/2! + (2+4*t+3*t^2)*x^3/3! + ... satisfies the autonomous differential equation dA/dx = f(A). The n-th row polynomial (n>=1) equals D^(n-1)(f(x)) evaluated at x = 0, where D is the operator f(x)*d/dx (apply [Dominici, Theorem 4.1]). - Peter Bala, Nov 09 2011
The polynomials (1+t)^(n-1)*p_n(1/(1+t)) are (up to sign) the row polynomials of A042977. - Peter Bala, Jul 23 2012
Let q_n = Sum_{k>=0} a(n,k)*t^(n-k), with q_0 = 1. (So q_1=t, q_2 = t+t^2, and q_3 = 3*t + 4*t^2 + 2*t^3.) Then Sum_{n>=0} q_n*x^n/n! = t - W((t-1-t^2*x)*exp(t-1)), where W is the Lambert function. - Ira M. Gessel, Jan 06 2012

A176824 a(n) = (n+1)^n mod n^n.

Original entry on oeis.org

0, 1, 10, 113, 1526, 24337, 450066, 9492289, 225159022, 5937424601, 172385029466, 5465884225969, 187964560069638, 6968912374274593, 277133723845128226, 11767703728247765249, 531431035966023003614, 25434534147318166381993, 1286040688679372821752042
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

From Peter Bala, Sep 12 2012: (Start)
a(n) = (n+1)^n - 2*n^n (since 2*n^n <= (n+1)^n < 3*n^n for n >= 1).
In terms of the tree function T(x) = Sum_{n >= 1} n^(n-1)*x^n/n! of A000169 the e.g.f. is T(x)*(2*x + T(x)*(T(x)-2))/(x^2*(T(x)-1)^3) = x + 10*x^2/2! + 113*x^3/3! + ... . (End)
a(n) = Sum_{i=1..n-1} C(n,i-1)*i^(i-1)*(n-i)^(n-i). - Vladimir Kruchinin, Sep 07 2015
a(n) = A000169(n+1) - 2*A000312(n). - Michel Marcus, Sep 07 2015, after Peter Bala

Extensions

a(19) from Vincenzo Librandi, Sep 07 2015

A052302 Number of Greg trees with n black nodes.

Original entry on oeis.org

1, 1, 1, 2, 5, 12, 37, 116, 412, 1526, 5995, 24284, 101619, 434402, 1893983, 8385952, 37637803, 170871486, 783611214, 3625508762, 16906577279, 79395295122, 375217952457, 1783447124452, 8521191260092, 40907997006020, 197248252895597, 954915026282162
Offset: 0

Views

Author

Christian G. Bower, Nov 15 1999

Keywords

Comments

A Greg tree can be described as a tree with 2-colored nodes where only the black nodes are counted and the white nodes are of degree at least 3.

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(binomial(g(i)+j-1, j)*b(n-i*j, i-1), j=0..n/i)))
        end:
    g:= n-> `if`(n<1, 0, b(n-1$2)+b(n, n-1)):
    a:= n-> `if`(n=0, 1, g(n)-add(g(j)*g(n-j), j=0..n)):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jun 22 2018
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0,
        Sum[Binomial[g[i] + j - 1, j]*b[n - i*j, i - 1], {j, 0, n/i}]]];
    g[n_] := If[n < 1, 0, b[n - 1, n - 1] + b[n, n - 1]];
    a[n_] := If[n == 0, 1, g[n] - Sum[g[j]*g[n - j], {j, 0, n}]];
    a /@ Range[0, 40] (* Jean-François Alcover, Jun 11 2021, after Alois P. Heinz *)

Formula

G.f.: 1 + B(x) - B(x)^2 where B(x) is g.f. of A052300.

A176825 Primes of the form (k+1)^k mod k^k.

Original entry on oeis.org

113, 24337, 9492289
Offset: 1

Views

Author

Keywords

Comments

The next term is too large to include.
The corresponding values of k are 4, 6, 8, 132, ... - Amiram Eldar, Jul 18 2019

Examples

			5^4 mod 4^4 = 113 is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Table[Mod[(n+1)^n,n^n],{n,140}],PrimeQ[ # ]&]
Showing 1-10 of 11 results. Next