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

A005728 Number of fractions in Farey series of order n.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 19, 23, 29, 33, 43, 47, 59, 65, 73, 81, 97, 103, 121, 129, 141, 151, 173, 181, 201, 213, 231, 243, 271, 279, 309, 325, 345, 361, 385, 397, 433, 451, 475, 491, 531, 543, 585, 605, 629, 651, 697, 713, 755, 775, 807, 831, 883, 901, 941, 965
Offset: 0

Views

Author

Keywords

Comments

Sometimes called Phi(n).
Leo Moser found an interesting way to generate this sequence, see Gardner.
a(n) is a prime number for nine consecutive values of n: n = 1, 2, 3, 4, 5, 6, 7, 8, 9. - Altug Alkan, Sep 26 2015
Named after the English geologist and writer John Farey, Sr. (1766-1826). - Amiram Eldar, Jun 17 2021

Examples

			a(5)=11 because the fractions are 0/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/1.
		

References

  • Martin Gardner, The Last Recreations, 1997, chapter 12.
  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Mathematics, a foundation for computer science, Chapter 4.5 - Relative Primality, pages 118 - 120 and Chapter 9 - Asymptotics, Problem 6, pages 448 - 449, Addison-Wesley Publishing Co., Reading, Mass., 1989.
  • William Judson LeVeque, Topics in Number Theory, Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, p. 154.
  • Andrey O. Matveev, Farey Sequences, De Gruyter, 2017, Table 1.7.
  • Leo Moser, Solution to Problem P42, Canadian Mathematical Bulletin, Vol. 5, No. 3 (1962), pp. 312-313.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

For the Farey series see A006842/A006843.
Essentially the same as A049643.

Programs

  • GAP
    List([0..60],n->Sum([1..n],i->Phi(i)))+1; # Muniru A Asiru, Jul 31 2018
    
  • Haskell
    a005728 n = a005728_list
    a005728_list = scanl (+) 1 a000010_list
    -- Reinhard Zumkeller, Aug 04 2012
    
  • Magma
    [1] cat [n le 1 select 2 else Self(n-1)+EulerPhi(n): n in [1..60]]; // Vincenzo Librandi, Sep 27 2015
    
  • Maple
    A005728 := proc(n)
        1+add(numtheory[phi](i),i=1..n) ;
    end proc:
    seq(A005728(n),n=0..80) ; # R. J. Mathar, Nov 29 2017
  • Mathematica
    Accumulate@ Array[ EulerPhi, 54, 0] + 1
    f[n_] := 1 + Sum[ EulerPhi[m], {m, n}]; Array[f, 55, 0] (* or *)
    f[n_] := (Sum[ MoebiusMu[m] Floor[n/m]^2, {m, n}] + 3)/2; f[0] = 1; Array[f, 55, 0] (* or *)
    f[n_] := n (n + 3)/2 - Sum[f[Floor[n/m]], {m, 2, n}]; f[0] = 1; Array[f, 55, 0] (* Robert G. Wilson v, Sep 26 2015 *)
    a[n_] := If[n == 0, 1, FareySequence[n] // Length];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jul 16 2022 *)
  • PARI
    a(n)=1+sum(k=1,n,eulerphi(k)) \\ Charles R Greathouse IV, Jun 03 2013
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A005728(n): # based on second formula in A018805
        if n == 0:
            return 1
        c, j = -2, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*(2*A005728(k1)-3)
            j, k1 = j2, n//j2
        return (n*(n-1)-c+j)//2 # Chai Wah Wu, Mar 24 2021

Formula

a(n) = 1 + Sum_{i=1..n} phi(i).
a(n) = n*(n+3)/2 - Sum_{k=2..n} a(floor(n/k)). - David W. Wilson, May 25 2002
a(n) = a(n-1) + phi(n) with a(0) = 1. - Arkadiusz Wesolowski, Oct 13 2012
a(n) = 1 + A002088(n). - Robert G. Wilson v, Sep 26 2015

A000248 Expansion of e.g.f. exp(x*exp(x)).

Original entry on oeis.org

1, 1, 3, 10, 41, 196, 1057, 6322, 41393, 293608, 2237921, 18210094, 157329097, 1436630092, 13810863809, 139305550066, 1469959371233, 16184586405328, 185504221191745, 2208841954063318, 27272621155678841, 348586218389733556, 4605223387997411873
Offset: 0

Views

Author

Keywords

Comments

Number of forests with n nodes and height at most 1.
Equivalently, number of idempotent mappings f from a set of n elements into itself (i.e., satisfying f o f = f). - Robert FERREOL, Oct 11 2007
In other words, a(n) = number of idempotents in the full semigroup of maps from [1..n] to itself. [Tainiter]
a(n) is the number of ways to select a set partition of {1,2,...,n} and then designate one element in each block (cell) of the partition.
Let set B have cardinality n. Then a(n) is the number of functions f:D->C over all partitions {D,C} of B. See the example in the Example Section below. We note that f:empty set->B is designated as the null function, whereas f:B->empty set is undefined unless B itself is empty. - Dennis P. Walsh, Dec 05 2013
In physics, a(n) would be interpreted as the number of projection operators P on S_n, i.e., ones satisfying P^2 = P. Example: a particle with a half-integer spin s has a spin space with 2s+1 base states which admits a(2s+1) linear projection operators (including the identity). These are important because they satisfy the operator identity exp(zU) = 1+(exp(z)-1)*U, valid for any complex z. - Stanislav Sykora, Nov 03 2016

Examples

			a(3)=10 since, for B={1,2,3}, we have 10 functions: 1 function of the type f:empty set->B; 6 functions of the type f:{x}->B\{x}; and 3 functions of the type f:{x,y}->B\{x,y}. - _Dennis P. Walsh_, Dec 05 2013
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 91.
  • 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).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 5.32(d).

Crossrefs

First row of array A098697.
Row sums of A133399.
Column k=1 of A210725, A279636.
Column k=2 of A245501.

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!(Exp(x*Exp(x)))); [Factorial(n-1)*b[n]: n in [1..m]]; // Vincenzo Librandi, Feb 01 2020
  • Maple
    A000248 := proc(n) local k; add(k^(n-k)*binomial(n, k), k=0..n); end; # Robert FERREOL, Oct 11 2007
    a:= proc(n) option remember; if n=0 then 1 else add(binomial(n-1, j) *(j+1) *a(n-1-j), j=0..n-1) fi end: seq(a(n), n=0..20); # Zerinvary Lajos, Mar 28 2009
  • Mathematica
    CoefficientList[Series[Exp[x Exp[x]],{x,0,20}],x]*Table[n!,{n,0,20}]
    a[0] = 1; a[1] = 1; a[n_] := a[n] = a[n - 1] + Sum[(Binomial[n - 1, j] + (n - 1) Binomial[n - 2, j]) a[j], {j, 0, n - 2}]; Table[a[n], {n, 0, 20}] (* David Callan, Oct 04 2013 *)
    Flatten[{1,Table[Sum[Binomial[n,k]*(n-k)^k,{k,0,n}],{n,1,20}]}] (* Vaclav Kotesovec, Jul 13 2014 *)
    Table[Sum[BellY[n, k, Range[n]], {k, 0, n}], {n, 0, 20}] (* Vladimir Reshetnikov, Nov 09 2016 *)
  • PARI
    a(n)=sum(k=0,n,binomial(n,k)*(n-k)^k); \\ Paul D. Hanna, Jun 26 2009
    
  • PARI
    x='x+O('x^66); Vec(serlaplace(exp(x*exp(x)))) \\ Joerg Arndt, Oct 06 2013
    
  • Sage
    # uses[bell_matrix from A264428]
    B = bell_matrix(lambda k: k+1, 20)
    print([sum(B.row(n)) for n in range(20)]) # Peter Luschny, Sep 03 2019
    

Formula

G.f.: Sum_{k>=0} x^k/(1-k*x)^(k+1). - Vladeta Jovovic, Oct 25 2003
a(n) = Sum_{k=0..n} C(n,k)*(n-k)^k. - Paul D. Hanna, Jun 26 2009
G.f.: G(0) where G(k) = 1 - x*(-1+2*k*x)^(2*k+1)/((x-1+2*k*x)^(2*k+2) - x*(x-1+2*k*x)^(4*k+4)/(x*(x-1+2*k*x)^(2*k+2) - (2*x-1+2*k*x)^(2*k+3)/G(k+1))) (continued fraction). - Sergei N. Gladkovskii, Jan 26 2013
E.g.f.: 1 + x/(1+x)*(G(0) - 1) where G(k) = 1 + exp(x)/(k+1)/(1-x/(x+(1)/G(k+1))) (continued fraction). - Sergei N. Gladkovskii, Feb 04 2013
Recurrence: a(0)=1, a(n) = Sum_{k=1..n} binomial(n-1,k-1)*k*a(n-k). - James East, Mar 30 2014
Asymptotics (Harris and Schoenfeld, 1968): a(n) ~ sqrt((r+1)/(2*Pi*(n+1)*(r^2+3*r+1))) * n! * exp((n+1)/(r+1)) / r^n, where r is the root of the equation r*(r+1)*exp(r) = n+1. - Vaclav Kotesovec, Jul 13 2014
a(n) = Sum_{k=0..n} A005727(k)*Stirling2(n, k). - Mélika Tebni, Jun 12 2022
More precise asymptotics: a(n) ~ n^(n + 1/2) / (sqrt(1 + 3*r + r^2) * exp(n - r*exp(r) + r/2) * r^(n + 1/2)), where r = 2*w - 1/(2*w) + 5/(8*w^2) - 19/(24*w^3) + 209/(192*w^4) - 763/(480*w^5) + 4657/(1920*w^6) - 6855/(1792*w^7) + 199613/(32256*w^8) + ... and w = LambertW(sqrt(n)/2). - Vaclav Kotesovec, Feb 20 2023

Extensions

In view of the multiple appearances of this sequence, I replaced the definition with the simple exponential generating function. - N. J. A. Sloane, Apr 16 2018

A215703 A(n,k) is the n-th derivative of f_k at x=1, and f_k is the k-th of all functions that are representable as x^x^...^x with m>=1 x's and parentheses inserted in all possible ways; square array A(n,k), n>=0, k>=1, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 2, 0, 1, 1, 4, 3, 0, 1, 1, 2, 12, 8, 0, 1, 1, 6, 9, 52, 10, 0, 1, 1, 4, 27, 32, 240, 54, 0, 1, 1, 2, 18, 156, 180, 1188, -42, 0, 1, 1, 2, 15, 100, 1110, 954, 6804, 944, 0, 1, 1, 8, 9, 80, 650, 8322, 6524, 38960, -5112, 0, 1, 1, 6, 48, 56, 590, 4908, 70098, 45016, 253296, 47160, 0
Offset: 0

Views

Author

Alois P. Heinz, Aug 21 2012

Keywords

Comments

A000081(m) distinct functions are representable as x^x^...^x with m>=1 x's and parentheses inserted in all possible ways. Some functions are representable in more than one way, the number of valid parenthesizations is A000108(m-1). The f_k are ordered, such that the number m of x's in f_k is a nondecreasing function of k. The exact ordering is defined by the algorithm below.
The list of functions f_1, f_2, ... begins:
| f_k : m : function (tree) : representation(s) : sequence |
+-----+---+------------------+--------------------------+----------+
| f_1 | 1 | x -> x | x | A019590 |
| f_2 | 2 | x -> x^x | x^x | A005727 |
| f_3 | 3 | x -> x^(x*x) | (x^x)^x | A215524 |
| f_4 | 3 | x -> x^(x^x) | x^(x^x) | A179230 |
| f_5 | 4 | x -> x^(x*x*x) | ((x^x)^x)^x | A215704 |
| f_6 | 4 | x -> x^(x^x*x) | (x^x)^(x^x), (x^(x^x))^x | A215522 |
| f_7 | 4 | x -> x^(x^(x*x)) | x^((x^x)^x) | A215705 |
| f_8 | 4 | x -> x^(x^(x^x)) | x^(x^(x^x)) | A179405 |

Examples

			Square array A(n,k) begins:
  1,   1,    1,    1,     1,     1,     1,     1, ...
  1,   1,    1,    1,     1,     1,     1,     1, ...
  0,   2,    4,    2,     6,     4,     2,     2, ...
  0,   3,   12,    9,    27,    18,    15,     9, ...
  0,   8,   52,   32,   156,   100,    80,    56, ...
  0,  10,  240,  180,  1110,   650,   590,   360, ...
  0,  54, 1188,  954,  8322,  4908,  5034,  2934, ...
  0, -42, 6804, 6524, 70098, 41090, 47110, 26054, ...
		

Crossrefs

Programs

  • Maple
    T:= proc(n) T(n):=`if`(n=1, [x], map(h-> x^h, g(n-1$2))) end:
    g:= proc(n, i) option remember; `if`(i=1, [x^n], [seq(seq(
          seq(mul(T(i)[w[t]-t+1], t=1..j)*v, v=g(n-i*j, i-1)), w=
          combinat[choose]([$1..nops(T(i))+j-1], j)), j=0..n/i)])
        end:
    f:= proc() local i, l; i, l:= 0, []; proc(n) while n>
          nops(l) do i:= i+1; l:= [l[], T(i)[]] od; l[n] end
        end():
    A:= (n, k)-> n!*coeff(series(subs(x=x+1, f(k)), x, n+1), x, n):
    seq(seq(A(n, 1+d-n), n=0..d), d=0..12);
  • Mathematica
    T[n_] := If[n == 1, {x}, Map[x^#&, g[n - 1, n - 1]]];
    g[n_, i_] := g[n, i] = If[i == 1, {x^n}, Flatten @ Table[ Table[ Table[ Product[T[i][[w[[t]] - t + 1]], {t, 1, j}]*v, {v, g[n - i*j, i - 1]}], {w, Subsets[ Range[ Length[T[i]] + j - 1], {j}]}], {j, 0, n/i}]];
    f[n_] := Module[{i = 0, l = {}}, While[n > Length[l], i++; l = Join[l, T[i]]]; l[[n]]];
    A[n_, k_] := n! * SeriesCoefficient[f[k] /. x -> x+1, {x, 0, n}];
    Table[Table[A[n, 1+d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* Jean-François Alcover, Nov 08 2019, after Alois P. Heinz *)

A179230 n-th derivative of x^(x^x) at x=1.

Original entry on oeis.org

1, 1, 2, 9, 32, 180, 954, 6524, 45016, 360144, 3023640, 27617832, 271481880, 2775329232, 31188079272, 350827041000, 4441125248640, 54110311240512, 765546040603584, 9938498593229568, 156934910753107200, 2128783325724881280, 37775147271084647424
Offset: 0

Views

Author

Henryk Trappmann (bo198214(AT)gmail.com), Jul 03 2010

Keywords

Comments

First term < 0: a(33) = -868875490363254484795699722301440.

Crossrefs

Cf. A005727. Column k=4 of A215703. Column k=3 of A277537.
Cf. A295103.

Programs

  • Maple
    a:= n-> n!*coeff(series(subs(x=x+1, x^(x^x) ), x, n+1), x, n):
    seq(a(n), n=0..30);  # Alois P. Heinz, Aug 20 2012
  • Mathematica
    Table[ D[ x^(x^x), {x, n}] /. x -> 1, {n, 0, 20}] (* Robert G. Wilson v, Jul 12 2010 *)
    NestList[ Factor[ D[ #1, x]] &, x^x^x, 20] /. x -> 1 (* Robert G. Wilson v, Aug 10 2010 *)
    Range[0, 22]! CoefficientList[ Series[(1 + x)^(1 + x)^(1 + x), {x, 0, 22}], x] (* Robert G. Wilson v, Feb 03 2013 *)

Formula

E.g.f.: (x+1)^((x+1)^(x+1)). - Alois P. Heinz, Aug 21 2012

Extensions

a(21)-a(22) from Alois P. Heinz, Aug 20 2012

A179405 n-th derivative of x^(x^(x^x)) at x=1.

Original entry on oeis.org

1, 1, 2, 9, 56, 360, 2934, 26054, 269128, 3010680, 37616880, 504880992, 7387701672, 115228447152, 1929016301016, 34194883090440, 643667407174464, 12757366498618176, 266426229010029696, 5830527979298793024, 133665090871032478080, 3197905600674249843840
Offset: 0

Views

Author

Robert G. Wilson v, Jul 13 2010

Keywords

Comments

First term < 0: a(329). - Alois P. Heinz, Sep 22 2015

Crossrefs

Column k=8 of A215703.
Column k=4 of A277537.

Programs

  • Maple
    a:= n-> n!*coeff(series(subs(x=x+1, x^(x^(x^x)) ), x, n+1), x, n):
    seq(a(n), n=0..30);  # Alois P. Heinz, Aug 20 2012
  • Mathematica
    f[n_] := D[ x^(x^(x^x)), {x, n}] /. x -> 1; Array[f, 18, 0]
    Range[0, 21]! CoefficientList[ Series[(1 + x)^(1 + x)^(1 + x)^(1 + x), {x, 0, 21}], x] (* Robert G. Wilson v, Feb 03 2013 *)

Formula

E.g.f.: (x+1)^((x+1)^((x+1)^(x+1))). - Alois P. Heinz, Aug 23 2012

Extensions

a(18)-a(21) from Alois P. Heinz, Aug 20 2012

A087761 Expansion of (1-x)^(1/(x-1)).

Original entry on oeis.org

1, 1, 4, 21, 140, 1130, 10674, 115206, 1396016, 18739080, 275712840, 4408612560, 76070179272, 1408041937848, 27816773482848, 583970117197320, 12978149959718400, 304310928180279360, 7506092106055537344
Offset: 0

Views

Author

Vladeta Jovovic, Oct 02 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[BellY[n, k, Table[m! HarmonicNumber[m], {m, n}]], {k, 0, n}], {n, 0, 20}] (* Vladimir Reshetnikov, Nov 09 2016 *)
  • PARI
    a(n)=if(n==0,1,(n-1)!*sum(k=0,n-1,(n-k)*sum(j=1,n-k,1/j)*a(k)/k!)) \\ Paul D. Hanna, Mar 17 2010; corrected Mar 19 2010

Formula

a(n) = Sum_{k=0..n} |Stirling1(n, k)|*A000248(k).
From Paul D. Hanna, Mar 17 2010: (Start)
E.g.f.: exp( Sum_{n>=1} H(n)*x^n ) where H(n) is the n-th harmonic number;
a(n) = (n-1)!*Sum_{k=0..n-1} (n-k)*H(n-k)*a(k)/k! for n>0 with a(0)=1. (End)
Empirical: a(n) = Sum_{i=0..n} binomial(n,i)*A005727(i)*(n-1)!/(i-1)! for n>0. - John M. Campbell, Dec 13 2016

A215524 n-th derivative of (x^x)^x at x=1.

Original entry on oeis.org

1, 1, 4, 12, 52, 240, 1188, 6804, 38960, 253296, 1654560, 11816640, 85816608, 668005728, 5240582592, 44667645120, 365989405440, 3494595006720, 28075694694912, 325862541872640, 2101211758356480, 39605981661066240, 48568198208302080, 7549838510211486720, -66667098077331572736
Offset: 0

Views

Author

Alois P. Heinz, Aug 14 2012

Keywords

Crossrefs

Column k=3 of A215703.

Programs

  • Maple
    a:= n-> n!*coeff(series(subs(x=x+1, (x^x)^x ), x, n+1), x, n):
    seq(a(n), n=0..30);
  • Mathematica
    m = 24; CoefficientList[((x+1)^(x+1))^(x+1) + O[x]^(m+1), x]*Range[0, m]! (* Jean-François Alcover, Feb 07 2021 *)

Formula

E.g.f.: ((x+1)^(x+1))^(x+1).

A277537 A(n,k) is the n-th derivative of the k-th tetration of x (power tower of order k) x^^k at x=1; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 2, 0, 0, 1, 1, 2, 3, 0, 0, 1, 1, 2, 9, 8, 0, 0, 1, 1, 2, 9, 32, 10, 0, 0, 1, 1, 2, 9, 56, 180, 54, 0, 0, 1, 1, 2, 9, 56, 360, 954, -42, 0, 0, 1, 1, 2, 9, 56, 480, 2934, 6524, 944, 0, 0, 1, 1, 2, 9, 56, 480, 4374, 26054, 45016, -5112, 0, 0
Offset: 0

Views

Author

Alois P. Heinz, Oct 19 2016

Keywords

Examples

			Square array A(n,k) begins:
  1, 1,   1,    1,     1,     1,     1,     1, ...
  0, 1,   1,    1,     1,     1,     1,     1, ...
  0, 0,   2,    2,     2,     2,     2,     2, ...
  0, 0,   3,    9,     9,     9,     9,     9, ...
  0, 0,   8,   32,    56,    56,    56,    56, ...
  0, 0,  10,  180,   360,   480,   480,   480, ...
  0, 0,  54,  954,  2934,  4374,  5094,  5094, ...
  0, 0, -42, 6524, 26054, 47894, 60494, 65534, ...
		

Crossrefs

Rows n=0..1 give A000012, A057427.
Main diagonal gives A033917.

Programs

  • Maple
    f:= proc(n) f(n):= `if`(n=0, 1, (x+1)^f(n-1)) end:
    A:= (n, k)-> n!*coeff(series(f(k), x, n+1), x, n):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
    # second Maple program:
    b:= proc(n, k) option remember; `if`(n=0, 1, `if`(k=0, 0,
          -add(binomial(n-1, j)*b(j, k)*add(binomial(n-j, i)*
          (-1)^i*b(n-j-i, k-1)*(i-1)!, i=1..n-j), j=0..n-1)))
        end:
    A:= (n, k)-> b(n, min(k, n)):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    b[n_, k_] := b[n, k] = If[n==0, 1, If[k==0, 0, -Sum[Binomial[n-1, j]*b[j, k]*Sum[Binomial[n-j, i]*(-1)^i*b[n-j-i, k-1]*(i-1)!, {i, 1, n-j}], {j, 0, n-1}]]]; A[n_, k_] := b[n, Min[k, n]]; Table[A[n, d-n], {d, 0, 14}, {n, 0, d}] // Flatten (* Jean-François Alcover, Jan 14 2017, adapted from 2nd Maple prog. *)

Formula

A(n,k) = [(d/dx)^n x^^k]_{x=1}.
E.g.f. of column k: (x+1)^^k.
A(n,k) = Sum_{i=0..min(n,k)} A277536(n,i).
A(n,k) = n * A295028(n,k) for n,k > 0.

A008296 Triangle of Lehmer-Comtet numbers of the first kind.

Original entry on oeis.org

1, 1, 1, -1, 3, 1, 2, -1, 6, 1, -6, 0, 5, 10, 1, 24, 4, -15, 25, 15, 1, -120, -28, 49, -35, 70, 21, 1, 720, 188, -196, 49, 0, 154, 28, 1, -5040, -1368, 944, 0, -231, 252, 294, 36, 1, 40320, 11016, -5340, -820, 1365, -987, 1050, 510, 45, 1, -362880, -98208, 34716, 9020, -7645, 3003, -1617, 2970, 825, 55, 1, 3628800
Offset: 1

Views

Author

Keywords

Comments

Triangle arising in the expansion of ((1+x)*log(1+x))^n.
Also the Bell transform of (-1)^(n-1)*(n-1)! if n>1 else 1 adding 1,0,0,0,... as column 0. For the definition of the Bell transform see A264428. - Peter Luschny, Jan 16 2016

Examples

			Triangle begins:
   1;
   1,  1;
  -1,  3,   1;
   2, -1,   6,  1;
  -6,  0,   5, 10,  1;
  24,  4, -15, 25, 15, 1;
  ...
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 139.

Crossrefs

Cf. A039621 (second kind), A354795 (variant), A185164, A005727 (row sums), A298511 (central).
Columns: A045406 (column 2), A347276 (column 3), A345651 (column 4).
Diagonals: A000142, A000217, A059302.
Cf. A176118.

Programs

  • Maple
    for n from 1 to 20 do for k from 1 to n do
    printf(`%d,`, add(binomial(l,k)*k^(l-k)*Stirling1(n,l), l=k..n)) od: od:
    # second program:
    A008296 := proc(n, k) option remember; if k=1 and n>1 then (-1)^n*(n-2)! elif n=k then 1 else (n-1)*procname(n-2, k-1) + (k-n+1)*procname(n-1, k) + procname(n-1, k-1) end if end proc:
    seq(print(seq(A008296(n, k), k=1..n)), n=1..7); # Mélika Tebni, Aug 22 2021
  • Mathematica
    a[1, 1] = a[2, 1] = 1; a[n_, 1] = (-1)^n (n-2)!;
    a[n_, n_] = 1; a[n_, k_] := a[n, k] = (n-1) a[n-2, k-1] + a[n-1, k-1] + (k-n+1) a[n-1,k]; Flatten[Table[a[n, k], {n, 1, 12}, {k, 1, n}]][[1 ;; 67]]
    (* Jean-François Alcover, Apr 29 2011 *)
  • PARI
    {T(n, k) = if( k<1 || k>n, 0, n! * polcoeff(((1 + x) * log(1 + x + x * O(x^n)))^k / k!, n))}; /* Michael Somos, Nov 15 2002 */
    
  • Sage
    # uses[bell_matrix from A264428]
    # Adds 1, 0, 0, 0, ... as column 0 at the left side of the triangle.
    bell_matrix(lambda n: (-1)^(n-1)*factorial(n-1) if n>1 else 1, 7) # Peter Luschny, Jan 16 2016

Formula

E.g.f. for a(n, k): (1/k!)[ (1+x)*log(1+x) ]^k. - Len Smiley
Left edge is (-1)*n!, for n >= 2. Right edge is all 1's.
a(n+1, k) = n*a(n-1, k-1) + a(n, k-1) + (k-n)*a(n, k).
a(n, k) = Sum_{m} binomial(m, k)*k^(m-k)*Stirling1(n, m).
From Peter Bala, Mar 14 2012: (Start)
E.g.f.: exp(t*(1 + x)*log(1 + x)) = Sum_{n>=0} R(n,t)*x^n/n! = 1 + t*x + (t+t^2)x^2/2! + (-t+3*t^2+t^3)x^3/3! + .... Cf. A185164. The row polynomials R(n,t) are of binomial type and satisfy the recurrence R(n+1,t) = (t-n)*R(n,t) + t*d/dt(R(n,t)) + n*t*R(n-1,t) with R(0,t) = 1 and R(1,t) = t. Inverse array is A039621.
(End)
Sum_{k=0..n} (-1)^k * a(n,k) = A176118(n). - Alois P. Heinz, Aug 25 2021

Extensions

More terms from James Sellers, Jan 26 2001
Edited by N. J. A. Sloane at the suggestion of Andrew Robbins, Dec 11 2007

A025566 a(n) = number of (s(0), s(1), ..., s(n)) such that every s(i) is a nonnegative integer, s(0) = 0, s(1) = 1, |s(i) - s(i-1)| <= 1 for i >= 2. Also a(n) = sum of numbers in row n+1 of the array T defined in A026105. Also a(n) = T(n,n), where T is the array defined in A025564.

Original entry on oeis.org

1, 1, 1, 3, 8, 22, 61, 171, 483, 1373, 3923, 11257, 32418, 93644, 271219, 787333, 2290200, 6673662, 19478091, 56930961, 166613280, 488176938, 1431878079, 4203938697, 12353600427, 36331804089, 106932444885, 314946659951, 928213563878
Offset: 0

Views

Author

Keywords

Comments

a(n+1) is the number of Motzkin (2n)-paths whose last weak valley occurs immediately after step n. A weak valley in a Motzkin path (A001006) is an interior vertex whose following step has nonnegative slope and whose preceding step has nonpositive slope. For example, the weak valleys in the Motzkin path F.UF.FD.UD occur after the first, third and fifth steps as indicated by the dots (U=upstep of slope 1, D=downstep of slope -1, F=flatstep of slope 0) and, with n=2, a(3)=3 counts FFUD, UDUD, UFFD. - David Callan, Jun 07 2006
Starting with offset 2: (1, 3, 8, 22, 61, 171, 483, ...), = row sums of triangle A136537. - Gary W. Adamson, Jan 04 2008

Crossrefs

First differences of A026135. Row sums of triangle A026105.
Pairwise sums of A005727. Column k=2 in A115990.
Cf. A136537.

Programs

  • GAP
    List([0..30],i->Sum([0..Int(i/2)],k->Binomial(i-2,k)*Binomial(i-k,k))); # Muniru A Asiru, Mar 09 2019
  • Maple
    seq( sum('binomial(i-2,k)*binomial(i-k,k)', 'k'=0..floor(i/2)), i=0..30 ); # Detlef Pauly (dettodet(AT)yahoo.de), Nov 09 2001
  • Mathematica
    CoefficientList[Series[x+(2x(x-1))/(1-3x-Sqrt[1-2x-3x^2]),{x,0,30}],x] (* Harvey P. Dale, Jun 12 2016 *)

Formula

G.f.: x + 2*x*(x-1)/(1-3x-sqrt(1-2x-3x^2)); for n > 1, first differences of the "directed animals" sequence A005773: a(n) = A005773(n) - A005773(n-1). - Emeric Deutsch, Aug 16 2002
Starting (1, 3, 8, 22, 61, 171, ...) gives the inverse binomial transform of A001791 starting (1, 4, 15, 56, 210, 792, ...). - Gary W. Adamson, Sep 01 2007
a(n) is the sum of the (n-2)-th row of triangle A131816. - Gary W. Adamson, Sep 01 2007
D-finite with recurrence n*a(n) +(-3*n+2)*a(n-1) +(-n+2)*a(n-2) +3*(n-4)*a(n-3)=0. - R. J. Mathar, Sep 15 2020
Showing 1-10 of 40 results. Next