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-40 of 438 results. Next

A026465 Length of n-th run of identical symbols in the Thue-Morse sequence A010060 (or A001285).

Original entry on oeis.org

1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1
Offset: 1

Views

Author

Keywords

Comments

It appears that the sequence can be calculated by any of the following methods:
(1) Start with 1 and repeatedly replace 1 with 1, 2, 1 and 2 with 1, 2, 2, 2, 1;
(2) a(1) = 1, all terms are either 1 or 2 and, for n > 0, a(n) = 1 if the length of the n-th run of 2's is 1; a(n) = 2 if the length of the n-th run of consecutive 2's is 3, with each run of 2's separated by a run of two 1's;
(3) replace each 3 in A080426 with 2. - John W. Layman, Feb 18 2003
Number of representations of n as a sum of Jacobsthal numbers (1 is allowed twice as a part). Partial sums are A003159. With interpolated zeros, g.f. is (Product_{k>=1} (1 + x^A078008(k)))/2. - Paul Barry, Dec 09 2004
In other words, the consecutive 0's or 1's in A010060 or A010059. - Robin D. Saunders (saunders_robin_d(AT)hotmail.com), Sep 06 2006
From Carlo Carminati, Feb 25 2011: (Start)
The sequence (starting with the second term) can also be calculated by the following method:
Apply repeatedly to the string S_0 = [2] the following algorithm: take a string S, double it, if the last figure is 1, just add the last figure to the previous one, if the last figure is greater than one, decrease it by one unit and concatenate a figure 1 at the end. (This algorithm is connected with the interpretation of the sequence as a continued fraction expansion.) (End)
This sequence, starting with the second term, happens to be the continued fraction expansion of the biggest cluster point of the set {x in [0,1]: F^k(x) >= x, for all k in N}, where F denotes the Farey map (see A187061). - Carlo Carminati, Feb 28 2011
Starting with the second term, the fixed point of the substitution 2 -> 211, 1 -> 2. - Carlo Carminati, Mar 03 2011
It appears that this sequence contains infinitely many distinct palindromic subsequences. - Alexander R. Povolotsky, Oct 30 2016
From Michel Dekking, Feb 13 2019: (Start)
Let tau defined by tau(0) = 01, tau(1) = 10 be the Thue-Morse morphism, with fixed point A010060. Consecutive runs in A010060 are 0, 11, 0, 1, 00, 1, 1, ..., which are coded by their lengths 1, 2, 1, 1, 2, ... Under tau^2 consecutive runs are mapped to consecutive runs:
tau^2(0) = 0110, tau^2(1) = 1001,
tau^2(00) = 01100110, tau^2(11) = 10011001.
The reason is that (by definition of a run!) runs of 0's and runs of 1's alternate in the sequence of runs, and this is inherited by the image of these runs under tau^2.
Under tau^2 the runs of length 1 are mapped to the sequence 1,2,1 of run lengths, and the runs of length 2 are mapped to the sequence 1,2,2,2,1 of run lengths. This proves John Layman's conjecture number (1): it follows that (a(n)) is fixed point of the morphism alpha
alpha: 1 -> 121, 2 -> 12221.
Since alpha(1) and alpha(2) are both palindromes, this also proves Alexander Povolotsky's conjecture.
(End)

Crossrefs

Cf. A010060, A001285, A101615, A026490 (run lengths).
A080426 is an essentially identical sequence with another set of constructions.
Cf. A104248 (bisection odious), A143331 (bisection evil), A003159 (partial sums).
Cf. A187061, A363361 (as continued fraction).

Programs

  • Haskell
    import Data.List (group)
    a026465 n = a026465_list !! (n-1)
    a026465_list = map length $ group a010060_list
    -- Reinhard Zumkeller, Jul 15 2014
    
  • Maple
    # From Carlo Carminati, Feb 25 2011:
    ## period-doubling routine:
    double:=proc(SS)
    NEW:=[op(S), op(S)]:
    if op(nops(NEW),NEW)=1
    then NEW:=[seq(op(j,NEW), j=1..nops(NEW)-2),op(nops(NEW)-1,NEW)+1]:
    else NEW:=[seq(op(j,NEW), j=1..nops(NEW)-1),op(nops(NEW)-1,NEW)-1,1]:
    fi:
    end proc:
    # 10 loops of the above routine generate the first 1365 terms of the sequence
    # (except for the initial term):
    S:=[2]:
    for j from 1 to 10  do S:=double(S); od:
    S;
    # From N. J. A. Sloane, Dec 31 2013:
    S:=[b]; M:=14;
    for n from 1 to M do T:=subs({b=[b,a,a], a=[b]}, S);
        S := map(x->op(x),T); od:
    T:=subs({a=1,b=2},S): T:=[1,op(T)]: [seq(T[n],n=1..40)];
  • Mathematica
    Length /@ Split@ Nest[ Flatten@ Join[#, # /. {1 -> 2, 2 -> 1}] &, {1}, 7]
    NestList[ Flatten[# /. {1 -> {2}, 2 -> {1, 1, 2}}] &, {1}, 7] // Flatten (* Robert G. Wilson v, May 20 2014 *)
  • PARI
    \\ See links.
    
  • Python
    def A026465(n):
        if n==1: return 1
        def iterfun(f,n=0):
            m, k = n, f(n)
            while m != k: m, k = k, f(k)
            return m
        def f(x):
            c, s = x, bin(x)[2:]
            l = len(s)
            for i in range(l&1^1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        return iterfun(lambda x:f(x)+n,n)-iterfun(lambda x:f(x)+n-1,n-1) # Chai Wah Wu, Jan 29 2025

Formula

a(1) = 1; for n > 1, a(n) = A003159(n) - A003159(n-1). - Benoit Cloitre, May 31 2003
G.f.: Product_{k>=1} (1 + x^A001045(k)). - Paul Barry, Dec 09 2004
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/2. - Amiram Eldar, Jan 16 2022

Extensions

Corrected and extended by John W. Layman, Feb 18 2003
Definition revised by N. J. A. Sloane, Dec 30 2013

A000151 Number of oriented rooted trees with n nodes. Also rooted trees with n nodes and 2-colored non-root nodes.

Original entry on oeis.org

1, 2, 7, 26, 107, 458, 2058, 9498, 44947, 216598, 1059952, 5251806, 26297238, 132856766, 676398395, 3466799104, 17873508798, 92630098886, 482292684506, 2521610175006, 13233573019372, 69687684810980, 368114512431638, 1950037285256658, 10357028326495097, 55140508518522726, 294219119815868952, 1573132563600386854, 8427354035116949486, 45226421721391554194
Offset: 1

Views

Author

Keywords

References

  • F. Bergeron, G. Labelle and P. Leroux, Combinatorial Species and Tree-Like Structures, Camb. 1998, p. 286.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, p. 307 and 564.
  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, p. 60, R(x).
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 138.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Also the self-convolution of A005750. - Paul D. Hanna, Aug 17 2002
Column k=2 of A242249.

Programs

  • Maple
    R:=series(x+2*x^2+7*x^3+26*x^4,x,5); M:=500;
    for n from 5 to M do
    series(add( subs(x=x^k,R)/k, k=1..n-1),x,n);
    t4:=coeff(series(x*exp(%)^2,x,n+1),x,n);
    R:=series(R+t4*x^n,x,n+1); od:
    for n from 1 to M do lprint(n,coeff(R,x,n)); od: # N. J. A. Sloane, Mar 10 2007
    with(combstruct):norootree:=[S, {B = Set(S), S = Prod(Z,B,B)}, unlabeled] :seq(count(norootree,size=i),i=1..30); # with Algolib (Pab Ter)
  • Mathematica
    terms = 30; A[] = 0; Do[A[x] = x*Exp[2*Sum[A[x^k]/k, {k, 1, terms}]] + O[x]^(terms+1) // Normal, terms+1]; CoefficientList[A[x], x] // Rest
    (* Jean-François Alcover, Jun 08 2011, updated Jan 11 2018 *)
  • PARI
    seq(N) = {my(A=vector(N, j, 1)); for (n=1, N-1, A[n+1] = 2/n * sum(i=1, n, sumdiv(i, d, d*A[d]) * A[n-i+1] ) ); A} \\ Andrew Howroyd, May 13 2018

Formula

Generating function A(x) = x+2*x^2+7*x^3+26*x^4+... satisfies A(x)=x*exp( 2*sum_{k>=1}(A(x^k)/k) ) [Harary]. - Pab Ter (pabrlos2(AT)yahoo.com), Oct 12 2005
G.f.: x*Product_{n>=1} 1/(1 - x^n)^(2*a(n)) = Sum_{n>=1} a(n)*x^n.
a(n) ~ c * d^n / n^(3/2), where d = A245870 = 5.64654261623294971289271351621..., c = 0.2078615974229174213216534920508516879353537904602582293754027908931077971... - Vaclav Kotesovec, Aug 20 2014, updated Dec 26 2020

Extensions

Extended with alternate description by Christian G. Bower, Apr 15 1998
More terms from Pab Ter (pabrlos2(AT)yahoo.com), Oct 12 2005

A005011 Shifts one place left under 5th-order binomial transform.

Original entry on oeis.org

1, 1, 6, 41, 331, 3176, 35451, 447981, 6282416, 96546231, 1611270851, 28985293526, 558413253581, 11458179765541, 249255304141006, 5725640423174901, 138407987170952351, 3510263847256823056
Offset: 0

Views

Author

Keywords

Comments

Length-n restricted growth strings (RGS) [s(0),s(1),...,s(n-1)] where s(k)<=F(k)+5 where F(0)=0 and F(k+1)=s(k+1) if s(k+1)-s(k)=5, otherwise F(k+1)=F(k); see examples in A004211, A004212, and A004213, and Fxtbook link. [Joerg Arndt, Apr 30 2011]

References

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

Crossrefs

Cf. A075500 (row sums).
A004211 (RGS where s(k)<=F(k)+2), A004212 (s(k)<=F(k)+3), A004213 (s(k)<=F(k)+4), A000110 (s(k)<=F(k)+1). - Joerg Arndt, Apr 30 2011

Programs

  • Mathematica
    Table[5^n BellB[n, 1/5], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 20 2015 *)
  • PARI
    x='x+O('x^66);
    egf=exp(intformal(exp(5*x))); /* =  1 + x + 3*x^2 + 41/6*x^3 + 331/24*x^4 + ... */
    /* egf=exp(1/5*(exp(5*x)-1)) */ /* alternative computation */
    Vec(serlaplace(egf)) /* Joerg Arndt, Apr 30 2011 */

Formula

a(n) = Sum_{m=0..n} 5^(n-m)*Stirling2(n, m), n >= 0.
E.g.f.: exp((exp(5*x)-1)/5).
O.g.f. A(x) satisfies A'(x)/A(x) = exp(5*x).
E.g.f.: exp(Integral_{t = 0..x} exp(5*t)). - Joerg Arndt, Apr 30 2011
O.g.f.: Sum_{k>=0} x^k/Product_{j=1..k} (1-5*j*x). - Joerg Arndt, Apr 30 2011
Define f_1(x), f_2(x), ... such that f_1(x)=e^x, f_{n+1}(x) = (d/dx)(x*f_n(x)), for n=2,3,.... Then a(n) = e^(-1/5)*5^{n-1}*f_n(1/5). - Milan Janjic, May 30 2008
a(n) = upper left term in M^n, M = an infinite square production matrix in which a diagonal of (5,5,5,...) is appended to the right of Pascal's triangle:
1, 5, 0, 0, 0, ...
1, 1, 5, 0, 0, ...
1, 2, 1, 5, 0, ...
1, 3, 3, 1, 5, ...
... - Gary W. Adamson, Jul 29 2011
G.f.: T(0)/(1-x), where T(k) = 1 - 5*x^2*(k+1)/( 5*x^2*(k+1) - (1-x-5*x*k)*(1-6*x-5*x*k)/T(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Oct 25 2013
G.f. A(x) satisfies: A(x) = 1 + x*A(x/(1 - 5*x))/(1 - 5*x). - Ilya Gutkovskiy, May 03 2019
a(n) ~ 5^n * n^n * exp(n/LambertW(5*n) - 1/5 - n) / (sqrt(1 + LambertW(5*n)) * LambertW(5*n)^n). - Vaclav Kotesovec, Jul 15 2021
From Peter Bala, Jun 29 2024: (Start)
a(n) = exp(-1/5)*Sum_{n >= 0} (5*n)^k/(n!*5^n).
Touchard's congruence holds: for all primes p != 5, a(p+k) == (a(k) + a(k+1)) (mod p) for k = 0,1,2,.... In particular, a(p) == 2 (mod p) for all primes p != 5. See A004211. (End)

A000995 Shifts left two terms under the binomial transform.

Original entry on oeis.org

0, 1, 0, 1, 2, 4, 10, 29, 90, 295, 1030, 3838, 15168, 63117, 275252, 1254801, 5968046, 29551768, 152005634, 810518729, 4472244574, 25497104007, 149993156234, 909326652914, 5674422994544, 36408092349897, 239942657880360
Offset: 0

Views

Author

Keywords

Comments

The binomial transform of A000995 has g.f. x*c(x)^2/(1+x^2*c(x)^2). - Paul Barry, Oct 06 2007
Equals row sums of triangle A137854 such that A000995(3) = 1 = first row of triangle A137854. - Gary W. Adamson, Feb 15 2008
a(n) is the number of permutations of [n-1] that avoid both of the dashed patterns 1-23 and 3-12 and start with an ascent (or are empty). For example, a(5)=4 counts 1432, 2314, 2431, 3421. - David Callan, Dec 02 2011

Examples

			A(x) = x + x^3/(1-x)^2 + x^5/((1-x)*(1-2x))^2 + x^7/((1-x)*(1-2x)*(1-3x))^2 +...
		

References

  • Ulrike Sattler, Decidable classes of formal power series with nice closure properties, Diplomarbeit im Fach Informatik, Univ. Erlangen - Nuernberg, Jul 27 1994
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a000995 n = a000995_list !! n
    a000995_list = 0 : 1 : vs where
      vs = 0 : 1 : g 2 where
        g x = (x + sum (zipWith (*) (map (a007318' x) [2..x]) vs)) : g (x + 1)
    -- Reinhard Zumkeller, Jun 02 2013
  • Maple
    A000995 := proc(n) local k; option remember; if n <= 1 then n else n + add(binomial(n, k)*A000995(k - 2), k = 2 .. n); fi; end;
  • Mathematica
    a[n_] := a[n] = If[n <= 1, n, n + Sum[Binomial[n, k]*a[k-2], {k, 2, n}]]; Join[{0, 1}, Table[a[n], {n, 0, 24}]] (* Jean-François Alcover, May 18 2011, after Maple prog. *)
    (* Computation using e.g.f.: *)
    nn=20; S=(Series[-2 E^(t/2) Sqrt[E^ t] (BesselI[0, 2] BesselK[0, 2 Sqrt[E^t]] - BesselK[0, 2] Hypergeometric0F1[1, E^t]), {t, 0, nn}]); Flatten[{0, 1, FullSimplify[Table[CoefficientList[Normal[S], t][[i]] (i - 1)!, {i, 1, nn}]]}] (* Pierre-Louis Giscard, Aug 12 2014 *)
  • PARI
    a(n)=polcoeff(sum(k=0,n,x^(2*k+1)/prod(j=0,k,1-j*x+x*O(x^n))^2),n) \\ Paul D. Hanna, Oct 28 2006
    

Formula

Since this satisfies a recurrence similar to that of the Bell numbers (A000110), the asymptotic behavior is presumably just as complicated - see A000110 for details.
However, A000994(n)/A000995(n) [ e.g., 77464/63117 ] -> 1.228..., the constant in A051148 and A051149.
O.g.f.: A(x) = Sum_{n>=0} x^(2*n+1)/Product_{k=0..n} (1-k*x)^2. - Paul D. Hanna, Oct 28 2006
G.f.: (1+2*x^2*c(x)^2)/(1+x^2*c(x^2)), c(x) the g.f. of A000108. - Paul Barry, Oct 06 2007. This g.f. is incorrect. - Vaclav Kotesovec, Aug 14 2014
E.g.f: -2 * exp(x) *( BesselI_0(2) * BesselK_0(2*exp(x/2)) - BesselK_0(2) * 0F1([], [1], exp(x)) ); see the Mathematica program. - Pierre-Louis Giscard, Aug 12 2014
G.f. A(x) satisfies: A(x) = x*(1 + x*A(x/(1 - x))/(1 - x)). - Ilya Gutkovskiy, May 02 2019

Extensions

More terms from Paul D. Hanna, Oct 28 2006

A001809 a(n) = n! * n(n-1)/4.

Original entry on oeis.org

0, 0, 1, 9, 72, 600, 5400, 52920, 564480, 6531840, 81648000, 1097712000, 15807052800, 242853811200, 3966612249600, 68652904320000, 1255367393280000, 24186745110528000, 489781588488192000, 10400656084955136000, 231125690776780800000, 5364548928029491200000
Offset: 0

Views

Author

Keywords

Comments

a(n) = n!*n*(n-1)/4 gives the total number of inversions in all the permutations of [n]. [Stern, Terquem] Proof: For fixed i,j and for fixed I,J (i < j, I > J, 1 <= i,j,I,J <= n), we have (n-2)! permutations p of [n] for which p(i)=I and p(j)=J (permute {1,2,...,n} \ {I,J} in the positions (1,2,...,n) \ {i,j}). There are n*(n-1)/2 choices for the pair (i,j) with i < j and n*(n-1)/2 choices for the pair (I,J) with I > J. Consequently, the total number of inversions in all the permutations of [n] is (n-2)!*(n*(n-1)/2)^2 = n!*n*(n-1)/4. - Emeric Deutsch, Oct 05 2006
To state this another way, a(n) is the number of occurrences of the pattern 12 in all permutations of [n]. - N. J. A. Sloane, Apr 12 2014
Equivalently, this is the total Denert index of all permutations on n letters (cf. A008302). - N. J. A. Sloane, Jan 20 2014
Also coefficients of Laguerre polynomials. a(n)=A021009(n,2), n >= 2.
a(n) is the number of edges in the Cayley graph of the symmetric group S_n with respect to the generating set consisting of transpositions. - Avi Peretz (njk(AT)netvision.net.il), Feb 20 2001
a(n+1) is the sum of the moments over all permutations of n. E.g. a(4) is [1,2,3].[1,2,3] + [1,3,2].[1,2,3] + [2,1,3].[1,2,3] + [2,3,1].[1,2,3] + [3,1,2].[1,2,3] + [3,2,1].[1,2.3] = 14 + 13 + 13 + 11 + 11 + 10 = 72. - Jon Perry, Feb 20 2004
Derivative of the q-factorial [n]!, evaluated at q=1. Example: a(3)=9 because (d/dq)[3]!=(d/dq)((1+q)(1+q+q^2))=2+4q+3q^2 is equal to 9 at q=1. - Emeric Deutsch, Apr 19 2007
Also the number of maximal cliques in the n-transposition graph for n > 1. - Eric W. Weisstein, Dec 01 2017
a(n-1) is the number of trees on [n], rooted at 1, with exactly two leaves. A leaf is a non-root vertex of degree 1. - Nikos Apostolakis, Dec 27 2021

Examples

			G.f. = x^2 + 9*x^3 + 72*x^4 + 600*x^5 + 5400*x^6 + 52920*x^7 + ...
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 799.
  • Simon Altmann and Eduardo L. Ortiz, Editors, Mathematical and Social Utopias in France: Olinde Rodrigues and His Times, Amer. Math. Soc., 2005.
  • David M. Bressoud, Proofs and Confirmations, Camb. Univ. Press, 1999; p. 90.
  • Cornelius Lanczos, Applied Analysis, Prentice-Hall, Englewood Cliffs, NJ, 1956, p. 519.
  • Edward M. Reingold, Jurg Nievergelt and Narsingh Deo, Combinatorial Algorithms, Prentice-Hall, 1977, section 7.1, p. 287.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Olry Terquem, Liouville's Journal, 1838.

Crossrefs

Cf. A034968 (the inversion numbers of permutations listed in alphabetic order). See also A053495 and A064038.

Programs

  • Magma
    [Factorial(n)*n*(n-1)/4: n in [0..20]]; // Vincenzo Librandi, Jun 15 2015
  • Maple
    A001809 := n->n!*n*(n-1)/4;
    with(combstruct):ZL:=[st, {st=Prod(left, right), left=Set(U, card=r), right=Set(U, card=1)}, labeled]: subs(r=1, stack): seq(count(subs(r=2, ZL), size=m), m=0..19); # Zerinvary Lajos, Feb 07 2008
    with (combstruct):with (combinat):a:=proc(m) [ZL, {ZL=Set(Cycle(Z, card>=m))}, labeled]; end: ZLL:=a(1):seq(count(ZLL, size=n)*binomial(n,2)/2, n=0..21); # Zerinvary Lajos, Jun 11 2008
  • Mathematica
    Table[n! n (n - 1)/4, {n, 0, 18}]
    Table[n! Binomial[n, 2]/2, {n, 0, 20}] (* Eric W. Weisstein, Dec 01 2017 *)
    Coefficient[Table[n! LaguerreL[n, x], {n, 20}], x, 2] (* Eric W. Weisstein, Dec 01 2017 *)
  • PARI
    {a(n) = n! * n * (n-1) / 4};
    
  • Sage
    [factorial(m) * binomial(m, 2) / 2 for m in range(19)]  # Zerinvary Lajos, Jul 05 2008
    

Formula

E.g.f.: (1/2)*x^2/(1-x)^3.
a(n) = a(n-1)*n^2/(n-2), n > 2; a(2)=1.
a(n) = n*a(n-1) + (n-1)!*n*(n-1)/2, a(1) = 0, a(2) = 1; a(n) = sum (first n! terms of A034968); a(n) = sum of the rises j of permutations (p(j)
If we define f(n,i,x) = Sum_{k=i..n} (Sum_{j=i..k}(C(k,j)*Stirling1(n,k)*Stirling2(j,i)*x^(k-j))) then a(n)=(-1)^n*f(n,2,-3), (n>=2). - Milan Janjic, Mar 01 2009
a(n) = Sum_k k*A008302(n,k). - N. J. A. Sloane, Jan 20 2014
a(n+2) = n*n!*(n+1)^2 / 4 = A000142(n) * (A000292(n) + A000330(n))/2 = sum of the cumulative sums of all the permutations of numbers from 1 to n, where A000142(n) = n! and sequences A000292(n) and A000330(n) are sequences of minimal and maximal values of cumulative sums of all the permutations of numbers from 1 to n. - Jaroslav Krizek, Sep 13 2014
From Amiram Eldar, Feb 15 2022: (Start)
Sum_{n>=2} 1/a(n) = 12 - 4*e.
Sum_{n>=2} (-1)^n/a(n) = 8*gamma - 4 - 4/e - 8*Ei(-1), where gamma is Euler's constant (A001620) and -Ei(-1) is the negated exponential integral at -1 (A099285). (End)

Extensions

More terms and new description from Michael Somos, May 19 2000
Simpler description from Emeric Deutsch, Oct 05 2006

A002955 Number of (unordered, unlabeled) rooted trimmed trees with n nodes.

Original entry on oeis.org

1, 1, 1, 2, 4, 8, 17, 36, 79, 175, 395, 899, 2074, 4818, 11291, 26626, 63184, 150691, 361141, 869057, 2099386, 5088769, 12373721, 30173307, 73771453, 180800699, 444101658, 1093104961, 2695730992, 6659914175, 16481146479, 40849449618
Offset: 1

Keywords

Comments

A rooted trimmed tree is a tree without limbs of length >= 2. Limbs are the paths from the leafs (towards the root) to the nearest branching point (with the root considered to be a branching point). [clarified by Joerg Arndt, Mar 03 2015]
A rooted tree with a forbidden limb of length k is a rooted tree where the path from any leaf inward hits a branching node or the root within k steps.
Also counts the unordered rooted trees without "x x" in the level sequence for the pre-order walk. The bijection transforms the two outmost nodes in all limbs of lengths >= 2 into V-shaped subtrees. - Joerg Arndt, Mar 03 2015

References

  • K. L. McAvaney, personal communication.
  • A. J. Schwenk, Almost all trees are cospectral, pp. 275-307 of F. Harary, editor, New Directions in the Theory of Graphs. Academic Press, NY, 1973.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=2 of A255636.

Programs

  • Maple
    with(numtheory): a:= proc(n) option remember; local d,j,aa; aa:= n-> a(n)-`if`(n=2,1,0); if n<=1 then n else (add(d*aa(d), d=divisors(n-1)) +add(add(d*aa(d), d=divisors(j)) *a(n-j), j=1..n-2))/ (n-1) fi end: seq(a(n), n=1..32); # Alois P. Heinz, Sep 06 2008
  • Mathematica
    a[n_] := a[n] = (Total[ #*b[#]& /@ Divisors[n-1] ] + Sum[ Total[ #*b[#]& /@ Divisors[j] ]*a[n-j], {j, 1, n-2}]) / (n-1); a[1] = 1; b[n_] := a[n]; b[2] = 0; Table[ a[n], {n, 1, 32}](* Jean-François Alcover, Nov 18 2011, after Maple *)

Formula

a(n) satisfies a=SHIFT_RIGHT(EULER(a-b)) where b(2)=1, b(k)=0 if k != 2.
a(n) ~ c * d^n / n^(3/2), where d = 2.59952511060090659632378883695107..., c = 0.391083882871301267612387143401... . - Vaclav Kotesovec, Aug 24 2014

Extensions

More terms, formula and comments from Christian G. Bower, Dec 15 1999

A038055 Number of n-node rooted trees with nodes of 2 colors.

Original entry on oeis.org

2, 4, 14, 52, 214, 916, 4116, 18996, 89894, 433196, 2119904, 10503612, 52594476, 265713532, 1352796790, 6933598208, 35747017596, 185260197772, 964585369012, 5043220350012, 26467146038744, 139375369621960, 736229024863276, 3900074570513316, 20714056652990194
Offset: 1

Author

Christian G. Bower, Jan 04 1999

Crossrefs

Cf. A000081, A038056-A038062, A271878 (multisets).
Cf. A245870.

Programs

  • Maple
    spec := [N, {N=Prod(bead,Set(N)), bead=Union(R,B), R=Atom, B=Atom}]; [seq(combstruct[count](spec, size=n), n=1..40)];
    # second Maple program:
    with(numtheory):
    a:= proc(n) option remember; `if`(n<2, 2*n, (add(add(d*
          a(d), d=divisors(j))*a(n-j), j=1..n-1))/(n-1))
        end:
    seq(a(n), n=1..30);  # Alois P. Heinz, May 11 2014
  • Mathematica
    a[n_] := a[n] = If[n<2, 2*n, (Sum[Sum[d*a[d], {d, Divisors[j]}]*a[n-j], {j, 1, n-1}])/(n-1)]; Table[a[n], {n, 1, 30}] (* Jean-François Alcover, Feb 25 2015, after Alois P. Heinz *)
    a[1] = 2; a[n_] := a[n] = Sum[k a[k] a[n - m k]/(n-1), {k, n}, {m, (n-1)/k}]; Table[a[n], {n, 30}] (* Vladimir Reshetnikov, Aug 12 2016 *)
  • PARI
    seq(N) = {my(A=vector(N, j, 1)); for (n=1, N-1, A[n+1] = 2/n * sum(i=1, n, sumdiv(i, d, d*A[d]) * A[n-i+1] ) ); 2*A} \\ Andrew Howroyd, May 12 2018

Formula

Shifts left and halves under Euler transform.
a(n) = 2*A000151(n).
a(n) ~ c * d^n / n^(3/2), where d = A245870 = 5.646542616232949712892713516..., c = 0.41572319484583484264330698410170337587070758092051645875080558178621559423... . - Vaclav Kotesovec, Sep 11 2014, updated Dec 26 2020

A005012 Shifts one place left under 6th-order binomial transform.

Original entry on oeis.org

1, 1, 7, 55, 505, 5497, 69823, 1007407, 16157905, 284214097, 5432922775, 112034017735, 2476196276617, 58332035387017, 1457666574447247, 38485034941511935, 1069787864231083297, 31213730550761076769, 953352927192964243879, 30406448846308128741847
Offset: 0

Keywords

References

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

Crossrefs

Cf. A004211.

Programs

  • GAP
    List([0..20],n->Sum([0..n],m->6^(n-m)*Stirling2(n,m))); # Muniru A Asiru, Mar 20 2018
  • Maple
    seq(6^n*BellB(n,1/6), n = 0 .. 50); # Robert Israel, Oct 20 2015
  • Mathematica
    Table[6^n BellB[n, 1/6], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 20 2015 *)

Formula

a(n) = sum((6^(n-m))*stirling2(n,m), m=0..n). stirling2(n,m)=A008277(n,m).
E.g.f.: exp((exp(6*x)-1)/6) satisfies A'(x)/A(x) = exp(6*x).
G.f.: T(0)/(x*(1-x)) -1/x, where T(k) = 1 - 6*x^2*(k+1)/( 6*x^2*(k+1) - (1-x-6*x*k)*(1-7*x-6*x*k)/T(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Oct 25 2013
a(n) = 6^n * B(n,1/6) where B(n,x) is the Bell polynomial of degree n. - Vladimir Reshetnikov, Oct 20 2015
O.g.f.: Sum_{k>=0} x^k/Product_{j=1..k} (1 - 6*j*x). - Ilya Gutkovskiy, Mar 20 2018
a(n) ~ 6^n * n^n * exp(n/LambertW(6*n) - 1/6 - n) / (sqrt(1 + LambertW(6*n)) * LambertW(6*n)^n). - Vaclav Kotesovec, Jul 15 2021

Extensions

a(0)=1 inserted by Alois P. Heinz, Oct 20 2015

A063895 Start with x, xy; then concatenate each word in turn with all preceding words, getting x xy xxy xxxy xyxxy xxxxy xyxxxy xxyxxxy ...; sequence gives number of words of length n. Also binary trees by degree: x (x,y) (x,(x,y)) (x,(x,(x,y))) ((x,y),(x,(x,y)))...

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 6, 11, 22, 43, 88, 179, 372, 774, 1631, 3448, 7347, 15713, 33791, 72923, 158021, 343495, 749102, 1638103, 3591724, 7893802, 17387931, 38379200, 84875596, 188036830, 417284181, 927469845, 2064465341, 4601670625, 10270463565, 22950838755
Offset: 1

Author

Claude Lenormand (claude.lenormand(AT)free.fr), Aug 29 2001

Comments

Also binary rooted identity trees (those with no symmetries, cf. A004111).
From Gus Wiseman, May 04 2021: (Start)
Also the number of unlabeled binary rooted semi-identity trees with 2*n - 1 nodes. In a semi-identity tree, only the non-leaf branches directly under any given vertex are required to be distinct. Alternatively, an unlabeled rooted tree is a semi-identity tree iff the non-leaf branches of the root are all distinct and are themselves semi-identity trees. For example, the a(3) = 1 through a(6) = 6 trees are:
(o(oo)) (o(o(oo))) ((oo)(o(oo))) ((oo)(o(o(oo)))) ((o(oo))(o(o(oo))))
(o(o(o(oo)))) (o((oo)(o(oo)))) ((oo)((oo)(o(oo))))
(o(o(o(o(oo))))) ((oo)(o(o(o(oo)))))
(o((oo)(o(o(oo)))))
(o(o((oo)(o(oo)))))
(o(o(o(o(o(oo))))))
The a(8) = 11 trees with 15 nodes:
((o(oo))((oo)(o(oo))))
((o(oo))(o(o(o(oo)))))
((oo)((oo)(o(o(oo)))))
((oo)(o((oo)(o(oo)))))
((oo)(o(o(o(o(oo))))))
(o((o(oo))(o(o(oo)))))
(o((oo)((oo)(o(oo)))))
(o((oo)(o(o(o(oo))))))
(o(o((oo)(o(o(oo))))))
(o(o(o((oo)(o(oo))))))
(o(o(o(o(o(o(oo)))))))
(End)

Crossrefs

The non-semi-identity version is 2*A001190(n)-1, ranked by A111299.
Semi-binary trees are also counted by A001190, but ranked by A292050.
The not necessarily binary version is A306200, ranked A306202.
The Matula-Goebel numbers of these trees are A339193.
The plane tree version is A343663.
A000081 counts unlabeled rooted trees with n nodes.
A004111 counts identity trees, ranked by A276625.
A306201 counts balanced semi-identity trees, ranked by A306203.
A331966 counts lone-child avoiding semi-identity trees, ranked by A331965.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, n*(3-n)/2, add(a(i)*a(n-i),
          i=1..(n-1)/2)+`if`(irem(n, 2, 'r')=0, (p->(p-1)*p/2)(a(r)), 0))
        end:
    seq(a(n), n=1..50);  # Alois P. Heinz, Aug 02 2013
  • Mathematica
    a[n_] := a[n] = If[n<3, n*(3-n)/2, Sum[a[i]*a[n-i], {i, 1, (n-1)/2}]+If[{q, r} = QuotientRemainder[n, 2]; r == 0, (a[q]-1)*a[q]/2, 0]]; Table[a[n], {n, 1, 36}] (* Jean-François Alcover, Feb 25 2014, after Alois P. Heinz *)
    ursiq[n_]:=Join@@Table[Select[Union[Sort/@Tuples[ursiq/@ptn]],#=={}||#=={{},{}}||Length[#]==2&&(UnsameQ@@DeleteCases[#,{}])&],{ptn,IntegerPartitions[n-1]}];Table[Length[ursiq[n]],{n,1,15,2}] (* Gus Wiseman, May 04 2021 *)
  • PARI
    {a(n)=local(A, m); if(n<1, 0, m=1; A=O(x); while( m<=n, m*=2; A=1-sqrt(1-2*x-2*x^2+subst(A, x, x^2))); polcoeff(A, n))}

Formula

a(n) = (sum a(i)*a(j), i+j=n, i2. a(1)=a(2)=1.
G.f. A(x) = 1-sqrt(1-2x-2x^2+A(x^2)) satisfies x+x^2-A(x)+(A(x)^2-A(x^2))/2=0, A(0)=0. - Michael Somos, Sep 06 2003
a(n) ~ c * d^n / n^(3/2), where d = 2.33141659246516873904600076533362924695..., c = 0.2873051160895040470174351963... . - Vaclav Kotesovec, Sep 11 2014

Extensions

Additional comments and g.f. from Christian G. Bower, Nov 29 2001

A080599 Expansion of e.g.f.: 2/(2-2*x-x^2).

Original entry on oeis.org

1, 1, 3, 12, 66, 450, 3690, 35280, 385560, 4740120, 64751400, 972972000, 15949256400, 283232149200, 5416632421200, 110988861984000, 2425817682288000, 56333385828720000, 1385151050307024000, 35950878932544576000, 982196278209226080000, 28175806418228108640000
Offset: 0

Author

Detlef Pauly (dettodet(AT)yahoo.de), Feb 24 2003

Keywords

Comments

Number of ordered partitions of {1,..,n} with at most 2 elements per block. - Bob Proctor, Apr 18 2005
In other words, number of preferential arrangements of n things (see A000670) in which each clump has size 1 or 2. - N. J. A. Sloane, Apr 13 2014
Recurrences (of the hypergeometric type of the Jovovic formula) mean: multiplying the sequence vector from the left with the associated matrix of the recurrence coefficients (here: an infinite lower triangular matrix with the natural numbers in the main diagonal and the triangular series in the subdiagonal) recovers the sequence up to an index shift. In that sense, this sequence here and many other sequences of the OEIS are eigensequences. - Gary W. Adamson, Feb 14 2011
Number of intervals in the weak (Bruhat) order of S_n that are Boolean algebras. - Richard Stanley, May 09 2011
a(n) = D^n(1/(1-x)) evaluated at x = 0, where D is the operator sqrt(1+2*x)*d/dx. Cf. A000085, A005442 and A052585. - Peter Bala, Dec 07 2011
From Gus Wiseman, Jul 04 2020: (Start)
Also the number of (1,1,1)-avoiding or cubefree sequences of length n covering an initial interval of positive integers. For example, the a(0) = 1 through a(3) = 12 sequences are:
() (1) (11) (112)
(12) (121)
(21) (122)
(123)
(132)
(211)
(212)
(213)
(221)
(231)
(312)
(321)
(End)

Examples

			From _Gus Wiseman_, Jul 04 2020: (Start)
The a(0) = 1 through a(3) = 12 ordered set partitions with block sizes <= 2 are:
  {}  {{1}}  {{1,2}}    {{1},{2,3}}
             {{1},{2}}  {{1,2},{3}}
             {{2},{1}}  {{1,3},{2}}
                        {{2},{1,3}}
                        {{2,3},{1}}
                        {{3},{1,2}}
                        {{1},{2},{3}}
                        {{1},{3},{2}}
                        {{2},{1},{3}}
                        {{2},{3},{1}}
                        {{3},{1},{2}}
                        {{3},{2},{1}}
(End)
		

Crossrefs

Column k=2 of A276921.
Cubefree numbers are A004709.
(1,1)-avoiding patterns are A000142.
(1,1,1)-avoiding compositions are A232432.
(1,1,1)-matching patterns are A335508.
(1,1,1)-avoiding permutations of prime indices are A335511.
(1,1,1)-avoiding compositions are ranked by A335513.
(1,1,1,1)-avoiding patterns are A189886.

Programs

  • Magma
    [n le 2 select 1 else (n-1)*Self(n-1) + Binomial(n-1,2)*Self(n-2): n in [1..31]]; // G. C. Greubel, Jan 31 2023
    
  • Maple
    a:= n-> n! *(Matrix([[1,1], [1/2,0]])^n)[1,1]:
    seq(a(n), n=0..40);  # Alois P. Heinz, Jun 01 2009
    a:= gfun:-rectoproc({a(n) = n*a(n-1)+(n*(n-1)/2)*a(n-2),a(0)=1,a(1)=1},a(n),remember):
    seq(a(n), n=0..40); # Robert Israel, Nov 01 2015
  • Mathematica
    Table[n!*SeriesCoefficient[-2/(-2+2*x+x^2),{x,0,n}],{n,0,20}] (* Vaclav Kotesovec, Oct 13 2012 *)
    Round@Table[n! ((1+Sqrt[3])^(n+1) - (1-Sqrt[3])^(n+1))/(2^(n+1) Sqrt[3]), {n, 0, 20}] (* Vladimir Reshetnikov, Oct 31 2015 *)
  • PARI
    Vec(serlaplace((2/(2-2*x-x^2) + O(x^30)))) \\ Michel Marcus, Nov 02 2015
    
  • SageMath
    A002605=BinaryRecurrenceSequence(2,2,0,1)
    def A080599(n): return factorial(n)*A002605(n+1)/2^n
    [A080599(n) for n in range(41)] # G. C. Greubel, Jan 31 2023

Formula

a(n) = n*a(n-1) + (n*(n-1)/2)*a(n-2). - Vladeta Jovovic, Aug 22 2003
E.g.f.: 1/(1-x-x^2/2). - Richard Stanley, May 09 2011
a(n) ~ n!*((1+sqrt(3))/2)^(n+1)/sqrt(3). - Vaclav Kotesovec, Oct 13 2012
a(n) = n!*((1+sqrt(3))^(n+1) - (1-sqrt(3))^(n+1))/(2^(n+1)*sqrt(3)). - Vladimir Reshetnikov, Oct 31 2015
a(n) = A090932(n) * A002530(n+1). - Robert Israel, Nov 01 2015
Previous Showing 31-40 of 438 results. Next