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.

User: Sergey Kirgizov

Sergey Kirgizov's wiki page.

Sergey Kirgizov has authored 10 sequences.

A343773 Excess of the number of even Motzkin n-paths (A107587) over the odd ones (A343386).

Original entry on oeis.org

1, 1, 0, -2, -3, 1, 11, 15, -13, -77, -86, 144, 595, 495, -1520, -4810, -2485, 15675, 39560, 6290, -159105, -324805, 87075, 1592843, 2616757, -2136539, -15726114, -20247800, 32296693, 152909577, 145139491, -417959049, -1460704685, -885536173, 4997618808, 13658704994
Offset: 0

Author

Keywords

Comments

All terms a(n), n >= 0, are contained in both A100223 and A214649, as well as in A007440 (if the signs of integers are not taken into account). So these sequences form a cluster, the base of which is the current sequence.
The Motzkin number A001006(n) is split into two parts A107587(n) and A343386(n) (see A343386). The value a(n), the difference between A107587(n) and A343386(n), can be called the "shadow" of A001006(n). This is clearly seen if we compare the g.f. for the Motzkin numbers M(x) = 1 + x*M(x) + x^2*M(x)^2 and the current g.f. A(x) = 1 + x*A(x) - x^2*A(x)^2.
Binomial transform of 1, 0, -1, 0, 2, 0, -5, 0, 14, 0, -42, 0, ... (see A000108). - Gennady Eremin, Jul 14 2021

Examples

			G.f. = 1 + x - 2*x^3 - 3*x^4 + x^5 + 11*x^6 + 15*x^7 - 13*x^8 - 77*x^9 - 86*x^10 + 144*x^11 + ...
		

Programs

  • Mathematica
    With[{$MaxExtraPrecision = 1000}, CoefficientList[Series[(-1 + x + Sqrt[1 - 2 x + 5 x^2])/(2 x^2), {x, 0, 36}], x] ] (* Michael De Vlieger, May 01 2021 *)
    a[n_] := Hypergeometric2F1[(1 - n)/2, -n/2, 2, -4];
    Table[a[n], {n, 0, 35}] (* Peter Luschny, May 30 2021 *)
    a[ n_] := If[n<0, 0, SeriesCoefficient[Nest[1 + x*# - (x*#)^2&, 1 + O[x], n], {x, 0, n}]]; (* Michael Somos, Oct 27 2024 *)
    a[ n_] := SeriesCoefficient[2/(1 - x + (1 - 2*x + 5*x^2)^(1/2)), {x, 0, n}]; (* Michael Somos, Oct 27 2024 *)
  • PARI
    {a(n) = my(y = 1 + O(x)); for(i = 1, n, y = 1 + x*y - x^2*y^2); polcoeff(y, n)}; /* Michael Somos, Oct 27 2024 */
    
  • PARI
    {a(n) = polcoeff( 2/(1 - x + (1 - 2*x + 5*x^2 + x*O(x^n))^(1/2)), n)}; /* Michael Somos, Oct 27 2024 */
  • Python
    A343773 = [1, 1]
    for n in range(2, 801):
        A343773.append(((2*n+1)*A343773[-1]
          - 5*(n-1)*A343773[-2]) // (n+2))
    

Formula

a(n) = A107587(n) - A343386(n), n>=0.
a(n) = A100223(n+2) = A214649(n+1), n>=0.
a(n) = (-1)^n * A007440(n+1), n>=0.
D-finite with recurrence a(n) = ((2*n+1)*a(n-1) - 5*(n-1)*a(n-2))/(n+2), n>1.
G.f.: (-1 + x + sqrt(1 - 2*x + 5*x^2))/(2*x^2).
G.f. A(x) satisfies A(x) = 1 + x*A(x) - x^2*A(x)^2.
a(n) = Sum_{k=0..floor(n/2)} (-1)^k * binomial(n, 2*k) * A000108(k).
a(n) = 2*A107587(n) - A001006(n) = A001006(n) - 2*A343386(n).
Limit_{n->oo} a(n)/A001006(n) = 0.
a(n) = hypergeom([(1 - n)/2, -n/2], [2], -4). - Peter Luschny, May 30 2021
G.f. A(x) with offset 1 is the reversion of g.f. for signed Fibonacci numbers 1, -1, 2, -3, 5, -8, 13, -21, 34, -55, ... (see A039834 starting at offset 1). - Gennady Eremin, Jul 15 2021

A343386 Number of odd Motzkin n-paths, i.e., Motzkin n-paths with an odd number of up steps.

Original entry on oeis.org

0, 0, 1, 3, 6, 10, 20, 56, 168, 456, 1137, 2827, 7458, 20670, 57577, 157691, 427976, 1170552, 3248411, 9096497, 25505562, 71436182, 200338074, 564083786, 1595055520, 4522769520, 12842772295, 36514010301, 103995490758, 296794937626, 848620165860, 2430089817720
Offset: 0

Author

Keywords

Comments

a(n) is the number of Motzkin n-paths with an odd number of U-steps (see A001006). For example, there are 9 Motzkin 4-paths, of which six have one U-step each, namely: 00UD, 0U0D, 0UD0, U00D, U0D0, and UD00. So a(4) = 6.
Number of Motzkin n-paths that, after removing the horizontal steps, are converted to Dyck (2m)-paths, where 2m <= n and m is odd (see A024492).

Examples

			G.f. = x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 20*x^6 + 56*x^7 + 168*x^8 + ...
		

Crossrefs

Programs

  • Mathematica
    a[n_] := ((n - 1) n HypergeometricPFQ[{1/2 - n/4, 3/4 - n/4, 1 - n/4, 5/4 - n/4}, {3/2, 3/2, 2}, 16])/2;
    Table[a[n], {n, 0, 31}] (* Peter Luschny, Sep 24 2021 *)
  • Python
    M = [4, 9]; E = [1, 1, 1, 1, 3];
    A343386 = [0, 0, 1, 3, 6]
    for n in range(5, 801):
        M.append(((2*n+1)*M[1]+(3*n-3)*M[0])//(n+2))
        E.append(((5*n**2+n-3)*E[4] - (10*n**2-16*n+3)*E[3]
          + (10*n**2-34*n+27)*E[2] + (11*n-5)*(n-3)*E[1]
          - 15*(n-3)*(n-4)*E[0]) // (n*n+2*n))
        A343386.append(M[-1] - E[-1])
        M.pop(0); E.pop(0)

Formula

a(n) = Sum_{k=0..n} binomial(n, 4*k+2) * A000108(2*k+1).
a(n) = A001006(n) - A107587(n).
G.f.: A(x) = (2 - 2*x - sqrt(1-2*x-3*x^2) - sqrt(1-2*x+5*x^2))/(4*x^2).
G.f. A(x) satisfies A(x) = x*A(x) + x^2*A(x)^2 + x^2*B(x)^2 where B(x) is the g.f. of A107587.
a(n) = A107587(n) - A100223(n+2). - R. J. Mathar, Apr 16 2021
D-finite with recurrence: n*(n+2)*a(n) + (-5*n^2-n+3)*a(n-1) + (10*n^2-16*n+3)*a(n-2) + (-10*n^2+34*n-27)*a(n-3) - (11*n-5)*(n-3)*a(n-4) + 15*(n-3)*(n-4)*a(n-5) = 0, n >= 5. - R. J. Mathar, Apr 17 2021
D-finite with recurrence: n*(n-2)*(n+2)*a(n) - (2*n-1)*(2*n^2-2*n-3)*a(n-1) + 3*(n-1)*(2*n^2-4*n+1)*a(n-2) - 2*(n-1)*(n-2)*(2*n-3)*a(n-3) - 15*(n-1)*(n-2)*(n-3)*a(n-4) = 0, n >= 4. - R. J. Mathar, Apr 17 2021
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2*k) * A000108(k) * (k mod 2). - Gennady Eremin, May 03 2021 [after Paul Barry (A107587)]
a(n) = ((n-1)*n*hypergeom([1/2-n/4, 3/4-n/4, 1-n/4, 5/4-n/4], [3/2, 3/2, 2], 16))/2. - Peter Luschny, Sep 24 2021
a(n) ~ 3^(n + 3/2) / (4*sqrt(Pi)*n^(3/2)). - Vaclav Kotesovec, Apr 27 2024

A340569 Total number of consecutive triples matching the pattern 123 in all faro permutations of length n.

Original entry on oeis.org

0, 0, 0, 1, 4, 10, 24, 53, 116, 246, 520, 1082, 2248, 4628, 9520, 19469, 39796, 81022, 164904, 334670, 679064, 1374924, 2783440, 5625666, 11368904, 22945820, 46307664, 93358228, 188202256, 379078952, 763506784, 1536708413, 3092806516, 6220970702, 12512656744, 25154958278
Offset: 0

Author

Sergey Kirgizov, Jan 12 2021

Keywords

Comments

Faro permutations are permutations avoiding the three consecutive patterns 231, 321 and 312. They are obtained by a perfect faro shuffle of two nondecreasing words of lengths differing by at most one.

Examples

			For n = 4, there are 6 faro permutations: 1234, 1243, 1324, 2134, 2143, 3142. They contain in total 4 consecutive patterns 123.
		

Crossrefs

A001405 counts faro permutations of length n.

Programs

  • Mathematica
    Table[SeriesCoefficient[x*(1+2*x)*(1-Sqrt[1-4*x^2])/((1-2*x) * (1+Sqrt[1-4*x^2])),{x,0,n}],{n,0,35}] (* Stefano Spezia, Jan 12 2021 *)

Formula

G.f.: x * (1+2*x) * (1-sqrt(1-4*x^2)) / ((1-2*x) * (1+sqrt(1-4*x^2))).

A340568 Total number of consecutive triples matching the pattern 132 in all faro permutations of length n.

Original entry on oeis.org

0, 0, 0, 1, 4, 10, 28, 61, 152, 318, 748, 1538, 3496, 7124, 15832, 32093, 70192, 141814, 306508, 617878, 1323272, 2663340, 5662600, 11383986, 24061264, 48330540, 101653368, 204049636, 427414672, 857503784, 1789891888, 3589478621, 7469802592, 14974962854, 31081371148
Offset: 0

Author

Sergey Kirgizov, Jan 11 2021

Keywords

Comments

Faro permutations are permutations avoiding the three consecutive patterns 231, 321 and 312. They are obtained by a perfect faro shuffle of two nondecreasing words of lengths differing by at most one. Also the popularity of consecutive pattern 213.

Examples

			For n = 4, there are 6 faro permutations: 1234, 1243, 1324, 2134, 2143, 3142. They contain in total 4 consecutive patterns 132 and also 4 consecutive patterns 213.
		

Crossrefs

A001405 counts faro permutations of length n.

Programs

  • PARI
    seq(n)={my(t=sqrt(1-4*x^2+O(x^n))); Vec(x*(-1+4*x^2+2*x+(1-2*x)*t) / ((1-2*x)*(1+t)*t), -(1+n))} \\ Andrew Howroyd, Jan 11 2021

Formula

G.f.: x*(-1+4*x^2+2*x+(1-2*x)*sqrt(1-4*x^2)) / ((1-2*x)*(1+sqrt(1-4*x^2))*sqrt(1-4*x^2)).

A340567 Total number of ascents in all faro permutations of length n.

Original entry on oeis.org

0, 0, 1, 4, 11, 26, 62, 134, 303, 634, 1394, 2872, 6206, 12676, 27068, 54994, 116423, 235706, 495722, 1001168, 2094714, 4223020, 8798756, 17715084, 36782246, 73980516, 153161332, 307808464, 635675228, 1276699336, 2630957432, 5281304554, 10863149303, 21797013946
Offset: 0

Author

Sergey Kirgizov, Jan 11 2021

Keywords

Comments

Faro permutations are permutations avoiding the three consecutive patterns 231, 321 and 312. They are obtained by a perfect faro shuffle of two nondecreasing words of lengths differing by at most one.

Examples

			For n = 3 there are 3 faro permutations, namely 123, 213, 132. They contain 4 ascents (12, 23, 13 and 13) in total.
		

Crossrefs

A001405 counts faro permutations of length n.
Cf. A107373 (descents), A340568, A340569.

Programs

  • PARI
    seq(n)={my(t=sqrt(1-4*x^2+O(x^n))); Vec(2*x*(4*x^2 + x + t - 1)/((1 - 2*x)*t*(t + 1)), -(1+n))} \\ Andrew Howroyd, Jan 11 2021

Formula

G.f.: 2*x*(4*x^2 + x + sqrt(1 - 4*x^2) - 1)/((1 - 2*x)*sqrt(1 - 4*x^2)*(sqrt(1 - 4*x^2) + 1)).

A335203 a(n) is the packing chromatic number of n-hypercube graph.

Original entry on oeis.org

2, 3, 5, 7, 15, 25, 49, 95
Offset: 1

Author

Sergey Kirgizov, May 26 2020

Keywords

Comments

A packing coloring of a graph associates an integer color to every graph vertex in such a way that for any k > 0 if two different vertices share the same color k, they must be at distance at least k+1. a(n) is the minimal number of colors (1,2,3,...) needed to perform a packing coloration of an n-dimensional hypercube graph. Only the first terms, up to n = 8, are known. In contrast, the ordinary chromatic number of any hypercube is always equals 2, since any hypercube is a bipartite graph.
There are no known exact formulas or recurrence relations. Some asymptotic results and bounds are given in the Formula section.

Examples

			Hypercube of dimension 1 needs 2 colors:
  1 --- 2
Hypercube of dimension 2 needs 3 colors:
  1 --- 2
  |     |
  |     |
  3 --- 1
Hypercube of dimension 3 needs 5 colors:
  1 ----------- 2
  | \         / |
  |  \       /  |
  |   4 --- 1   |
  |   |     |   |
  |   |     |   |
  |   2 --- 5   |
  |  /       \  |
  | /         \ |
  3 ----------- 1
		

Formula

a(n) ~ (1/2 - O(1/k)) * 2^k (Proposition 7.3 from Goddard et al.).
a(n) >= 2*a(n-1) - (n-1) (Corollary 1 from Torres and Valencia-Pabon).
a(n) <= 3 + 2^n * (1/2 - 1/(2^ceiling(log_2(n)))) - 2 * floor((n-4)/2) (Thm. 1 from Torres and Valencia-Pabon).

A302483 Number of FF-equivalence classes of Łukasiewicz paths. Łukasiewicz paths are P-equivalent iff the positions of pattern P are identical in these paths.

Original entry on oeis.org

1, 1, 2, 2, 5, 9, 17, 32, 59, 107, 192, 342, 606, 1070, 1885, 3316, 5828, 10237, 17975, 31555, 55387, 97210, 170605, 299405, 525434, 922088, 1618168, 2839704, 4983351, 8745190, 15346758, 26931703, 47261865, 82938813, 145547493, 255418068, 448227487, 786584431
Offset: 0

Author

Sergey Kirgizov, Apr 08 2018

Keywords

Comments

Number of FF-equivalence classes of Łukasiewicz paths. A Łukasiewicz path of length n is a lattice path from (0,0) to (n,0) using up steps U_{k} = (1,k) for any positive integer k, flat steps F = (1,0) and down steps D = (1,-1). Łukasiewicz paths are alpha-equivalent whenever the positions of occurrences of pattern alpha are identical on these paths.

Examples

			There are 14 Łukasiewicz of length 4 divided in the 5 following FF-equivalence classes: {FFFF}, {FFU_{1}D}, {U_{1}DFF}, {U_{1}FFD}, {FU_{1}DF, FU_{1}FD, FU_{2}DD, U_{1}DU_{1}D, U_{1}FDF, U_{1}U_{1}DD, U_{2}DDF, U_{2}DFD, U_{2}FDD, U_{3}DDD}.
		

Crossrefs

Cf. A001405, A191385, A000045, A005251, A000325, A011782, A001006, A023431, A292460, A004148 enumerates the numbers of P-equivalence classes of Łukasiewicz paths for other values of P.

Programs

  • Mathematica
    CoefficientList[Series[(1 - 3 x + 4 x^2 - 5 x^3 + 7 x^4 - 7 x^5 + 6 x^6 - 3 x^7 + x^8)/((1 - 2 x + x^2 - x^3) (1 - x)^2), {x, 0, 32}], x] (* Michael De Vlieger, Apr 12 2018 *)
  • PARI
    x='x+O('x^99); Vec((1-3*x+4*x^2-5*x^3+7*x^4-7*x^5+6*x^6-3*x^7+x^8)/((1-2*x+x^2-x^3)*(1-x)^2)) \\ Altug Alkan, Apr 12 2018

Formula

G.f.: (1 - 3*x + 4*x^2 - 5*x^3 + 7*x^4 - 7*x^5 + 6*x^6 - 3*x^7 + x^8) / ((1-2*x+x^2-x^3) * (1-x)^2).

A278679 Popularity of left children in treeshelves avoiding pattern T213.

Original entry on oeis.org

1, 5, 24, 128, 770, 5190, 38864, 320704, 2894544, 28382800, 300575968, 3419882304, 41612735632, 539295974000, 7417120846080, 107904105986048, 1655634186628352, 26721851169634560, 452587550053179392, 8026445538106839040, 148751109541600495104
Offset: 2

Author

Sergey Kirgizov, Nov 26 2016

Keywords

Comments

Treeshelves are ordered binary (0-1-2) increasing trees where every child is connected to its parent by a left or a right link. Classical Françon's bijection maps bijectively treeshelves into permutations. Pattern T213 illustrated below corresponds to a treeshelf constructed from permutation 213. Popularity is the sum of a certain statistic (number of left children, in this case) over all objects of size n.

Examples

			Treeshelves of size 3:
      1  1          1    1       1        1
     /    \        /      \     / \      / \
    2      2      /        \   2   \    /   2
   /        \    2          2       3  3
  3          3    \        /
                   3      3
Pattern T213:
    1
   / \
  2   \
       3
Treeshelves of size 3 that avoid pattern T213:
      1  1          1    1        1
     /    \        /      \      / \
    2      2      /        \    /   2
   /        \    2          2  3
  3          3    \        /
                   3      3
Popularity of left children is 5.
		

Programs

  • Mathematica
    terms = 21;
    egf = (E^(Sqrt[2] z)(4z - 4) - (Sqrt[2] - 2) E^(2 Sqrt[2] z) + Sqrt[2] + 2)/((Sqrt[2] - 2) E^(Sqrt[2] z) + 2 + Sqrt[2])^2;
    CoefficientList[egf + O[z]^(terms + 2), z]*Range[0, terms + 1]! // Round // Drop[#, 2]& (* Jean-François Alcover, Jan 26 2019 *)
  • Python
    ## by Taylor expansion
    from sympy import *
    from sympy.abc import z
    h = (exp(sqrt(2)*z) * (4*z-4) - (sqrt(2)-2)*exp(2*sqrt(2)*z) + sqrt(2) + 2) / ((sqrt(2)-2)*exp(sqrt(2)*z) + 2 + sqrt(2))**2
    NUMBER_OF_COEFFS = 20
    coeffs = Poly(series(h,n = NUMBER_OF_COEFFS)).coeffs()
    coeffs.reverse()
    ## and remove first coefficient 1 that corresponds to O(n**k)
    coeffs.pop(0)
    print([coeffs[n]*factorial(n+2) for n in range(len(coeffs))])

Formula

E.g.f.: (e^(sqrt(2)*z) * (4*z-4) - (sqrt(2)-2)*e^(2*sqrt(2)*z) + sqrt(2) + 2) / ((sqrt(2)-2)*e^(sqrt(2)*z) + 2 + sqrt(2))^2.
Asymptotic: n * (sqrt(2) / log(2*sqrt(2)+3) )^(n+1).

Extensions

More terms from Alois P. Heinz, Oct 27 2017

A278678 Popularity of left children in treeshelves avoiding pattern T321.

Original entry on oeis.org

1, 4, 19, 94, 519, 3144, 20903, 151418, 1188947, 10064924, 91426347, 887296422, 9164847535, 100398851344, 1162831155151, 14198949045106, 182317628906283, 2455925711626404, 34632584722468115, 510251350142181470, 7840215226100517191, 125427339735162102104
Offset: 2

Author

Sergey Kirgizov, Nov 26 2016

Keywords

Comments

Treeshelves are ordered binary (0-1-2) increasing trees where every child is connected to its parent by a left or a right link. Classical Françon's bijection maps bijectively treeshelves into permutations. Pattern T321 illustrated below corresponds to a treeshelf constructed from permutation 321. Popularity is the sum of a certain statistic (number of left children, in this case) over all objects of size n.

Examples

			Treeshelves of size 3:
      1  1          1    1       1        1
     /    \        /      \     / \      / \
    2      2      /        \   2   \    /   2
   /        \    2          2       3  3
  3          3    \        /
                   3      3
Pattern T321:
      1
     /
    2
   /
  3
Treeshelves of size 3 that avoid pattern T321:
  1          1    1       1        1
   \        /      \     / \      / \
    2      /        \   2   \    /   2
     \    2          2       3  3
      3    \        /
            3      3
Popularity of left children is 4.
		

Programs

  • Maple
    b:= proc(u, o) option remember; `if`(u+o=0, 1,
          add(b(o-1+j, u-j), j=1..u))
        end:
    a:= n-> (n+1)*b(n+1, 0)-b(n+2, 0):
    seq(a(n), n=2..25);  # Alois P. Heinz, Oct 27 2017
  • Mathematica
    b[u_, o_] := b[u, o] = If[u+o == 0, 1, Sum[b[o-1+j, u-j], {j, 1, u}]];
    a[n_] := (n+1)*b[n+1, 0] - b[n+2, 0];
    Table[a[n], {n, 2, 25}] (* Jean-François Alcover, Nov 06 2017, after Alois P. Heinz *)
  • Python
    # by Taylor expansion
    from sympy import *
    from sympy.abc import z
    h = (-sin(z) + 1 + (z-1)*cos(z))/ (1-sin(z))**2
    NUMBER_OF_COEFFS = 20
    coeffs = Poly(series(h,n = NUMBER_OF_COEFFS)).coeffs()
    coeffs.reverse()
    # and remove first coefficient 1 that corresponds to O(n**k)
    coeffs.pop(0)
    print([coeffs[n]*factorial(n+2) for n in range(len(coeffs))])

Formula

E.g.f.: (-sin(z) + 1 + (z-1)*cos(z))/ (1-sin(z))^2.
a(n) = (n+1)*e(n) - e(n+1), where e(n) is the n-th Euler number (see A000111).
Asymptotic: a(n) ~ 8*(Pi-2) / Pi^3 * n^2 * (2/Pi)^n.

A278677 a(n) = Sum_{k=0..n} A011971(n, k)*(k + 1). The Aitken-Bell triangle considered as a linear transform applied to the positive numbers.

Original entry on oeis.org

1, 5, 23, 109, 544, 2876, 16113, 95495, 597155, 3929243, 27132324, 196122796, 1480531285, 11647194573, 95297546695, 809490850313, 7126717111964, 64930685865768, 611337506786061, 5940420217001199, 59502456129204083, 613689271227219015, 6510381400140132872
Offset: 0

Author

Sergey Kirgizov, Nov 26 2016

Keywords

Comments

Original name: Popularity of left children in treeshelves avoiding pattern T231 (with offset 2).
Treeshelves are ordered binary (0-1-2) increasing trees where every child is connected to its parent by a left or a right link. Classical Françon's bijection maps bijectively treeshelves into permutations. Pattern T231 illustrated below corresponds to a treeshelf constructed from permutation 231. Popularity is the sum of a certain statistic (number of left children, in this case) over all objects of size n.
a(n) is also the sum of the last entries in all blocks of all set partitions of [n-1]. a(4) = 23 because the sum of the last entries in all blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 3+5+5+4+6 = 23. - Alois P. Heinz, Apr 24 2017
a(n-2) is the number of lines that rhyme (with at least one earlier line) across all rhyme schemes counted by A000110. - Martin Fuller, Apr 20 2025

Examples

			Treeshelves of size 3:
      1  1          1    1       1        1
     /    \        /      \     / \      / \
    2      2      /        \   2   \    /   2
   /        \    2          2       3  3
  3          3    \        /
                   3      3
Pattern T231:
     1
    /
   /
  2
   \
    3
Treeshelves of size 3 that avoid pattern T231:
      1  1      1       1        1
     /    \      \     / \      / \
    2      2      \   2   \    /   2
   /        \      2       3  3
  3          3    /
                 3
Popularity of left children here is 5.
		

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, [1, 0],
         (p-> p+[0, p[1]*n])(b(n-1, m+1))+m*b(n-1, m))
        end:
    a:= n-> b(n+1, 0)[2]:
    seq(a(n), n=0..22);  # Alois P. Heinz, Dec 15 2023
    # Using the generating function:
    gf := ((exp(z + exp(z)-1)*(z-1)) + exp(exp(z)-1))/z^2: ser := series(gf, z, 25):
    seq((n+2)!*coeff(ser, z, n), n=0..22);  # Peter Luschny, Feb 01 2025
  • Mathematica
    a[n_] := (n+3) BellB[n+2] - BellB[n+3];
    Table[a[n], {n, 0, 22}] (* Jean-François Alcover, Dec 01 2018 *)
  • Python
    from sympy import bell
    HOW_MANY = 30
    print([(n + 3) * bell(n+2) - bell(n + 3) for n in range(HOW_MANY)])

Formula

E.g.f.: ((exp(z + exp(z)-1)*(z-1)) + exp(exp(z)-1))/z^2.
a(n) = (n + 3)*b(n + 2) - b(n + 3) where b(n) is the n-th Bell number (see A000110).
Asymptotics: a(n) ~ n*b(n).
a(n) = Sum_{k=1..n+1} A285595(n+1,k)/k. - Alois P. Heinz, Apr 24 2017
a(n) = Sum_{k=0..n} Stirling2(n+2, k+1) * (n+1-k). - Ilya Gutkovskiy, Apr 06 2021
a(n) ~ n*Bell(n)*(1 - 1/LambertW(n)). - Vaclav Kotesovec, Jul 28 2021
a(n) = Sum_{k=n+1..(n+1)*(n+2)/2} k * A367955(n+1,k). - Alois P. Heinz, Dec 11 2023

Extensions

New name and offset 0 by Peter Luschny, Feb 01 2025