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-8 of 8 results.

A042977 Triangle T(n,k) read by rows: coefficients of a polynomial sequence occurring when calculating the n-th derivative of Lambert function W.

Original entry on oeis.org

1, -2, -1, 9, 8, 2, -64, -79, -36, -6, 625, 974, 622, 192, 24, -7776, -14543, -11758, -5126, -1200, -120, 117649, 255828, 248250, 137512, 45756, 8640, 720, -2097152, -5187775, -5846760, -3892430, -1651480, -445572, -70560, -5040
Offset: 0

Views

Author

Keywords

Comments

The first derivative of the Lambert W function is given by dW/dz = exp(-W)/(1+W). Further differentiation yields d^2/dz^2(W) = exp(-2*W)*(-2-W)/(1+W)^3, d^3/dz^3(W) = exp(-3*W)*(9+8*W+2*W^2)/(1+W)^5 and, in general, d^n/dz^n(W) = exp(-n*W)*R(n,W)/(1+W)^(2*n-1), where R(n,W) are the row polynomials of this triangle. - Peter Bala, Jul 22 2012
Conjecture: the polynomials have no real roots greater than or equal to -1. This is equivalent to the statement that the derivatives of the 0th branch of the Lambert W function have no real roots greater than -1/e. - Colin Linzer, Jan 29 2025

Examples

			Triangle begins:
 n\k |    1    W   W^2   W^3   W^4
==================================
  1  |    1
  2  |   -2   -1
  3  |    9    8     2
  4  |  -64  -79   -36    -6
  5  |  625  974   622   192    24
...
T(5,2) = -4*(-79) - 9*(-36) + 3*(-6) = 622.
		

Crossrefs

Cf. A013703 (twice row sums), A000444, A000525, A064781, A064785, A064782.
First column A000169, main diagonal A000142, first subdiagonal A052582.
Cf. A054589.

Programs

  • Maple
    # After Vladimir Kruchinin, for 0 <= m <= n:
    T := (n, m) -> add(add((-1)^(k+n)*binomial(j,k)*binomial(2*n+1,m-j)*(k+n+1)^(n+j), k=0..j)/j!, j=0..m): seq(seq(T(n, k), k=0..n), n=0..7); # Peter Luschny, Feb 23 2018
  • Mathematica
    Table[ Simplify[ (Evaluate[ D[ ProductLog[ z ], {z, n} ] ] /. ProductLog[ z ]->W)*z^n/W^n (1+W)^(2n-1) ], {n, 12} ] // TableForm
    Flatten[ Table[ CoefficientList[ Simplify[ (Evaluate[D[ProductLog[z], {z, n}]] /. ProductLog[z] -> W) z^n / W^n (1 + W)^(2 n - 1)], W], {n, 8}]] (* Michael Somos, Jun 07 2012 *)
    T[ n_, k_] := If[ n < 1 || k < 0, 0, Coefficient[ Simplify[(Evaluate[D[ProductLog[z], {z, n}]] /. ProductLog[z] -> W) z^n / W^n (1 + W)^(2 n - 1)], W, k]] (* Michael Somos, Jun 07 2012 *)
  • Maxima
    B(n):=(if n=1 then 1/(1+x)*exp(-x) else -n!*sum((sum((-1)^(m-j)*binomial(m,j)*sum((j^(n-i)*binomial(j,i)*x^(m-i))/(n-i)!,i,0,n),j,1,m))*B(m)/m!,m,1,n-1)/(1+x)^n);
    a(n):=B(n)*(1+x)^(2*n-1);
    /* Vladimir Kruchinin, Apr 07 2011 */
    
  • Maxima
    a(n):=if n=1 then 1 else (n-1)!*(sum((binomial(n+k-1, n-1)*sum(binomial(k, j)*(x+1)^(n-j-1)*sum(binomial(j, l)*(-1)^(l)*sum((l^(n+j-i-1)*binomial(l, i)*x^(j-i))/(n+j-i-1)!, i, 0, l), l, 1, j), j, 1, k)), k, 1, n-1));
    T(n, k):=coeff(ratsimp(a(n)), x, k);
    for n: 1 thru 12 do print(makelist(T(n, k), k, 0, n-1));
    /* Vladimir Kruchinin, Oct 09 2012 */
    T(n,m):=sum(binomial(2*n+1,m-j)*sum(((n+k+1)^(n+j)*(-1)^(n+k))/((j-k)!*k!),k,0,j),j,0,m); /* Vladimir Kruchinin, Feb 20 2018 */

Formula

E.g.f.: (LambertW(exp(x)*(x+y*(1+x)^2))-x)/(1+x). - Vladeta Jovovic, Nov 19 2003
a(n) = B(n)*(1+x)^(2*n-1), where B(1) = 1/(1+x), and for n>=2, B(n) = -(n!/(1+x)^n)*Sum_{m=1..n-1} (B(m)/m!)*Sum_{j=1..m} (-1)^(m-j)*binomial(m,j)*Sum_{i=0..n} j^(n-i)*binomial(j,i)*x^(m-i)/(n-i)!. - Vladimir Kruchinin, Apr 07 2011
Recurrence equation: T(n+1,k) = -n*T(n,k-1) - (3*n-k-1)*T(n,k) + (k+1)*T(n,k+1). - Peter Bala, Jul 22 2012
T(n,m) = Sum_{j=0..m} C(2*n+1,m-j)*(Sum_{k=0..j} (n+k+1)^(n+j)*(-1)^(n+k)/((j-k)!*k!)). - Vladimir Kruchinin, Feb 20 2018

A123202 Triangle of coefficients of n!*(1 - x)^n*L_n(x/(1 - x)), where L_n(x) is the Laguerre polynomial.

Original entry on oeis.org

1, 1, -2, 2, -8, 7, 6, -36, 63, -34, 24, -192, 504, -544, 209, 120, -1200, 4200, -6800, 5225, -1546, 720, -8640, 37800, -81600, 94050, -55656, 13327, 5040, -70560, 370440, -999600, 1536150, -1363572, 653023, -130922, 40320, -645120, 3951360, -12794880
Offset: 0

Views

Author

Roger L. Bagula, Oct 04 2006

Keywords

Comments

The n-th row consists of the coefficients in the expansion of Sum_{j=0..n} A021009(n,j)*x^j*(1 - x)^(n - j).

Examples

			Triangle begins:
       1;
       1,    -2;
       2,    -8,     7;
       6,   -36,    63,    -34;
      24,  -192,   504,   -544,   209;
     120, -1200,  4200,  -6800,  5225,  -1546;
     720, -8640, 37800, -81600, 94050, -55656, 13327;
      ... reformatted. - _Franck Maminirina Ramaharo_, Oct 13 2018
		

References

  • Milton Abramowitz and Irene A. Stegun, eds., Handbook of Mathematical Functions with Formulas, Graphs and Mathematical Tables, 9th printing. New York: Dover, 1972, p. 782.
  • Gengzhe Chang and Thomas W. Sederberg, Over and Over Again, The Mathematical Association of America, 1997, p. 164, figure 26.1.

Crossrefs

Programs

  • Maple
    M := (n,x) -> n!*subs(x=(x/(1-x)),orthopoly[L](n,x))*(1-x)^n:
    seq(print(seq(coeff(simplify(M(n,x)),x,k),k=0..n)),n=0..6); # Peter Luschny, Jan 05 2015
  • Mathematica
    w = Table[n!*CoefficientList[LaguerreL[n, x], x], {n, 0, 10}];
    v = Table[CoefficientList[Sum[w[[n + 1]][[m + 1]]*x^ m*(1 - x)^(n - m), {m, 0, n}], x], {n, 0, 10}]; Flatten[v]
  • Maxima
    create_list(ratcoef(n!*(1 - x)^n*laguerre(n, x/(1 - x)), x, k), n, 0, 10, k, 0, n); /* Franck Maminirina Ramaharo, Oct 13 2018 */
    
  • PARI
    row(n) = Vecrev(n!*(1-x)^n*pollaguerre(n, 0, x/(1 - x))); \\ Michel Marcus, Feb 06 2021

Formula

T(n, k) = [x^k] (n!*L_n(x)*(1 - x)^n) with L_n(x) the Laguerre polynomial after substituting x by x/(1 - x). - Peter Luschny, Jan 05 2015
From Franck Maminirina Ramaharo, Oct 13 2018: (Start)
G.f.: exp(-x*y/(1 - (1 - x)*y))/(1 - (1 - x)*y).
T(n,1) = A000142(n).
T(n,2) = -A052582(n).
T(n,n) = A002720(n). (End)

Extensions

Edited by N. J. A. Sloane, Jun 12 2007
Edited, new name, and offset corrected by Franck Maminirina Ramaharo, Oct 13 2018

A320582 Number T(n,k) of permutations p of [n] such that |{ j : |p(j)-j| = 1 }| = k; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 2, 0, 4, 0, 5, 6, 10, 2, 1, 21, 36, 42, 12, 9, 0, 117, 226, 219, 104, 47, 6, 1, 792, 1568, 1472, 800, 328, 64, 16, 0, 6205, 12360, 11596, 6652, 2658, 688, 148, 12, 1, 55005, 109760, 103600, 60840, 24770, 7120, 1560, 200, 25, 0, 543597, 1085560, 1030649, 614420, 255830, 77732, 17750, 2876, 365, 20, 1
Offset: 0

Views

Author

Alois P. Heinz, Jan 23 2019

Keywords

Examples

			T(4,0) = 5: 1234, 1432, 3214, 3412, 4231.
T(4,1) = 6: 2431, 3241, 3421, 4132, 4213, 4312.
T(4,2) = 10: 1243, 1324, 1342, 1423, 2134, 2314, 2413, 3124, 3142, 4321.
T(4,3) = 2: 2341, 4123.
T(4,4) = 1: 2143.
Triangle T(n,k) begins:
      1;
      1,      0;
      1,      0,      1;
      2,      0,      4,     0;
      5,      6,     10,     2,     1;
     21,     36,     42,    12,     9,    0;
    117,    226,    219,   104,    47,    6,    1;
    792,   1568,   1472,   800,   328,   64,   16,   0;
   6205,  12360,  11596,  6652,  2658,  688,  148,  12,  1;
  55005, 109760, 103600, 60840, 24770, 7120, 1560, 200, 25,  0;
  ...
		

Crossrefs

Column k=0 gives A078480.
Row sums give A000142.
Main diagonal gives A059841.

Programs

  • Maple
    b:= proc(s) option remember; expand((n-> `if`(n=0, 1, add(
         `if`(abs(n-j)=1, x, 1)*b(s minus {j}), j=s)))(nops(s)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b({$1..n})):
    seq(T(n), n=0..12);
  • Mathematica
    b[s_] := b[s] = Expand[With[{n = Length[s]}, If[n==0, 1, Sum[
         If[Abs[n-j]==1, x, 1]*b[s~Complement~{j}], {j, s}]]]];
    T[n_] := PadRight[CoefficientList[b[Range[n]], x], n+1];
    T /@ Range[0, 12] // Flatten (* Jean-François Alcover, Feb 09 2021, after Alois P. Heinz *)

Formula

Sum_{k=1..n} k * T(n,k) = A052582(n-1) for n > 0.
Sum_{k=0..n} (k+1) * T(n,k) = A082033(n-1) for n > 0.

A138770 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} such that there are exactly k entries between the entries 1 and 2 (n>=2, 0<=k<=n-2).

Original entry on oeis.org

2, 4, 2, 12, 8, 4, 48, 36, 24, 12, 240, 192, 144, 96, 48, 1440, 1200, 960, 720, 480, 240, 10080, 8640, 7200, 5760, 4320, 2880, 1440, 80640, 70560, 60480, 50400, 40320, 30240, 20160, 10080, 725760, 645120, 564480, 483840, 403200, 322560, 241920, 161280, 80640
Offset: 2

Views

Author

Emeric Deutsch, Apr 06 2008

Keywords

Comments

Sum of row n = n! = A000142(n).
The expected value of k is (n-2)/3. [Geoffrey Critzer, Dec 19 2009]

Examples

			T(4,2)=4 because we have 1342, 1432, 2341 and 2431.
Triangle starts:
  2;
  4,2;
  12,8,4;
  48,36,24,12;
  240,192,144,96,48;
  ...
		

Crossrefs

Programs

  • Maple
    T:=proc(n,k) if n-2 < k then 0 else (2*n-2*k-2)*factorial(n-2) end if end proc; for n from 2 to 10 do seq(T(n, k),k=0..n-2) end do; # yields sequence in triangular form
  • Mathematica
    Table[Table[2 (n - r) (n - 2)!, {r, 1, n - 1}], {n, 1, 10}] // Grid (* Geoffrey Critzer, Dec 19 2009 *)

Formula

T(n,k) = 2*(n-k-1)*(n-2)!.
T(n,0) = 2(n-1)! = A052849(n-1).
T(n,1) = A052582(n-2).
T(n,2) = A052609(n-2).
T(n,3) = 12*A005990(n-3).
T(n,4) = 48*A061206(n-5).
T(n,n-2) = 2(n-2)! (A052849).
Sum_{k=0..n-2} k*T(n,k) = n!*(n-2)/3 = A090672(n-1).

A108861 Numbers k that divide the sum of the digits of 2^k * k!.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 27, 81, 126, 159, 205, 252, 254, 267, 285, 675, 1053, 1086, 1125, 1146, 2007, 5088, 5382, 5448, 14652, 23401, 23574, 24009, 41004, 66789, 67482, 111480, 866538, 1447875, 2413152, 2414019, 2417828, 2421360, 4045482, 6713982
Offset: 1

Views

Author

Ryan Propper, Jul 11 2005

Keywords

Comments

Next term after 5448 is greater than 10000.
a(34) > 10^6. - D. S. McNeil, Mar 03 2009
a(39) > 2.54 * 10^6, if it exists. - Kevin P. Thompson, Oct 20 2021
a(41) > 7*10^6, if it exists. - Kevin P. Thompson, Dec 08 2021

Examples

			9 is a term because the sum of the digits of 2^9 * 9! = 185794560 is 45 which is divisible by 9.
		

Crossrefs

Programs

  • Mathematica
    Do[If[Mod[Plus @@ IntegerDigits[2^n * n! ], n] == 0, Print[n]], {n, 1, 10000}]
    Select[Range[6714000],Mod[Total[IntegerDigits[2^# #!]],#]==0&] (* Harvey P. Dale, Jul 11 2023 *)
  • PARI
    isok(k) = !(sumdigits(2^k * k!) % k); \\ Michel Marcus, Oct 20 2021
    
  • Python
    from itertools import islice
    def A108861(): # generator of terms
        k, k2, kf = 1, 2, 1
        while True:
            c = sum(int(d) for d in str(k2*kf))
            if not c % k: yield k
            k += 1
            k2 *= 2
            kf *= k
    A108861_list = list(islice(A108861(),10)) # Chai Wah Wu, Oct 26 2021

Extensions

a(25)-a(33) from D. S. McNeil, Mar 03 2009
a(34)-a(38) from Kevin P. Thompson, Oct 20 2021
a(39)-a(40) from Kevin P. Thompson, Dec 08 2021

A066237 First differences give A052849.

Original entry on oeis.org

1, 3, 7, 19, 67, 307, 1747, 11827, 92467, 818227, 8075827, 87909427, 1045912627, 13499954227, 187856536627, 2803205272627, 44648785048627, 756023641240627, 13560771052696627, 256850971870360627, 5122654988223640627
Offset: 1

Views

Author

Markus Sullivan (markus(AT)o-reading.co.uk), Dec 19 2001

Keywords

Comments

Partial sums of A098558. - Sébastien Desbordes, Dec 18 2023

Crossrefs

Programs

  • Mathematica
    RecurrenceTable[{a[0]==-1,a[1]==1,a[n]==n*a[n-1]-(n-1)a[n-2]},a,{n,30}] (* Harvey P. Dale, Dec 10 2013 *)

Formula

From Vladeta Jovovic, Dec 20 2001: (Start)
a(n) = n*a(n-1) - (n-1)*a(n-2), a(0)=-1, a(1)=1.
a(n) = 2*A003422(n) - 1. (End)

Extensions

More terms from Jason Earls, Jan 13 2002

A120928 Number of "ups" and "downs" in the permutations of [n] if either a previous counted "up" ("down") or a "void" precedes an "up" ("down") which then will be counted also.

Original entry on oeis.org

2, 8, 44, 280, 2040, 16800, 154560, 1572480, 17539200, 212889600, 2794176000, 39437798400, 595718323200, 9589612032000, 163895187456000, 2964061900800000, 56554301067264000, 1135354270482432000, 23923536413736960000, 527939735774330880000
Offset: 2

Views

Author

Thomas Wieder, Jul 16 2006

Keywords

Comments

An "up" ("down") is a neighboring pair of elements e_i, e_j of [n] with e_i < e_j (e_i > e_j). A "void" is a missing preceding pair, i.e., the start of [n]. We discuss two examples for [n=4]. In the permutation [3, 1, 2, 4] "void" precedes the pair 3,1 and consequently a "down" is counted. No "up" which has been counted precedes the "ups" 1,2 and 2,4 so they are not counted. In [3, 4, 1, 2] the "up" 3,4 is counted and so is the next "up" 1,2 but the down 4,1 has no preceding "down" registered and is therefore not counted.

Examples

			[1, 2, 3, 4], "ups"=3, "downs"=0;
[1, 2, 4, 3], "ups"=2, "downs"=0;
[1, 3, 2, 4], "ups"=2, "downs"=0;
[1, 3, 4, 2], "ups"=2, "downs"=0;
[1, 4, 2, 3], "ups"=2, "downs"=0;
[1, 4, 3, 2], "ups"=1, "downs"=0;
[2, 1, 3, 4], "ups"=0, "downs"=1;
[2, 1, 4, 3], "ups"=0, "downs"=2;
[2, 3, 1, 4], "ups"=2, "downs"=0;
[2, 3, 4, 1], "ups"=2, "downs"=0;
[2, 4, 1, 3], "ups"=2, "downs"=0;
[2, 4, 3, 1], "ups"=1, "downs"=0;
[3, 1, 2, 4], "ups"=0, "downs"=1;
[3, 1, 4, 2], "ups"=0, "downs"=2;
[3, 2, 1, 4], "ups"=0, "downs"=2;
[3, 2, 4, 1], "ups"=0, "downs"=2;
[3, 4, 1, 2], "ups"=2, "downs"=0;
[3, 4, 2, 1], "ups"=1, "downs"=0;
[4, 1, 2, 3], "ups"=0, "downs"=1;
[4, 1, 3, 2], "ups"=0, "downs"=2;
[4, 2, 1, 3], "ups"=0, "downs"=2;
[4, 2, 3, 1], "ups"=0, "downs"=2;
[4, 3, 1, 2], "ups"=0, "downs"=2;
[4, 3, 2, 1], "ups"=0, "downs"=3.
		

Crossrefs

Programs

  • Maple
    a:= n-> ceil(n!*(3*n-1)/6):
    seq(a(n), n=2..30); # Alois P. Heinz, Apr 21 2012

Formula

E.g.f.: -(6+6*x^2-4*x^3+x^4)/(-3+12*x-18*x^2+12*x^3-3*x^4). - Thomas Wieder, May 02 2009
a(2) = 2, a(n) = n! * (3*n - 1) / 6 for n > 2. - Jon E. Schoenfield, Apr 18 2010

Extensions

4 more terms from R. J. Mathar, Aug 25 2008
More terms from Alois P. Heinz, Apr 21 2012

A060694 A triangle related to rooted trees.

Original entry on oeis.org

1, 2, 1, 10, 8, 2, 82, 86, 36, 6, 938, 1202, 668, 192, 24, 13778, 20772, 14118, 5452, 1200, 120, 247210, 427828, 341122, 161688, 48312, 8640, 720, 5240338, 10228458, 9325398, 5184902, 1909920, 467784, 70560, 5040, 128149802, 278346286
Offset: 1

Views

Author

F. Chapoton, Apr 20 2001

Keywords

Comments

The rows sum to A006963, the alternating sum is A000311, the right column is A000142, the left column is related to A032188 (twice); the second-to-right column is A052582

Examples

			{1}, {2,1}, {10,8,2}, {82,86,36,6}, {938,1202,668,192,24}
		

Crossrefs

Formula

E.g.f. given by the Maple expression RootOf(-exp(_Z*x*t)+x*t*exp(_Z*x*t)+y*t*exp(-_Z+_Z*x*t)-y*t^2*x*exp(-_Z+_Z*x*t)+1-t+t*exp(-_Z+_Z*x*t)-x*t*exp(-_Z+_Z*x*t));

Extensions

More terms from Vladeta Jovovic, Apr 21 2001
Showing 1-8 of 8 results.