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

A000023 Expansion of e.g.f. exp(-2*x)/(1-x).

Original entry on oeis.org

1, -1, 2, -2, 8, 8, 112, 656, 5504, 49024, 491264, 5401856, 64826368, 842734592, 11798300672, 176974477312, 2831591702528, 48137058811904, 866467058876416, 16462874118127616, 329257482363600896, 6914407129633521664, 152116956851941670912
Offset: 0

Views

Author

Keywords

Comments

A010843, A000023, A000166, A000142, A000522, A010842, A053486, A053487 are successive binomial transforms with the e.g.f. exp(k*x)/(1-x) and recurrence b(n) = n*b(n-1)+k^n and are related to incomplete gamma functions at k. In this case k=-2, a(n) = n*a(n-1)+(-2)^n = Gamma(n+1,k)*exp(k) = Sum_{i=0..n} (-1)^(n-i)*binomial(n,i)*i^(n-i)*(i+k)^i. - Vladeta Jovovic, Aug 19 2002
a(n) is the permanent of the n X n matrix with -1's on the diagonal and 1's elsewhere. - Philippe Deléham, Dec 15 2003

Examples

			G.f. = 1 - x + 2*x^2 - 2*x^3 + 8*x^4 + 8*x^5 + 112*x^6 + 656*x^7 + ... - _Michael Somos_, Nov 20 2018
		

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 210.
  • 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
    a000023 n = foldl g 1 [1..n]
      where g n m = n*m + (-2)^m
    -- James Spahlinger, Oct 08 2012
    
  • Maple
    a := n -> n!*add(((-2)^k/k!), k=0..n): seq(a(n), n=0..27); # Zerinvary Lajos, Jun 22 2007
    seq(simplify(KummerU(-n, -n, -2)), n = 0..22); # Peter Luschny, May 10 2022
  • Mathematica
    FoldList[#1*#2 + (-2)^#2 &, 1, Range[22]] (* Robert G. Wilson v, Jul 07 2012 *)
    With[{r = Round[n!/E^2 - (-2)^(n + 1)/(n + 1)]}, r - (-1)^n Mod[(-1)^n r, 2^(n + Ceiling[-(2/n) - Log[2, n]])]] (* Stan Wagon May 02 2016 *)
    a[n_] := (-1)^n x D[1/x Exp[x], {x, n}] x^n Exp[-x]
    Table[a[n] /. x -> 2, {n, 0, 22}](* Gerry Martens , May 05 2016 *)
  • PARI
    a(n)=if(n<0,0,n!*polcoeff(exp(-2*x+x*O(x^n))/(1-x),n))
    
  • PARI
    my(x='x+O('x^66)); Vec( serlaplace( exp(-2*x)/(1-x)) ) \\ Joerg Arndt, Oct 06 2013
    
  • Python
    from sympy import exp, uppergamma
    def A000023(n):
        return exp(-2) * uppergamma(n + 1, -2)  # David Radcliffe, Aug 20 2025
  • Sage
    @CachedFunction
    def A000023(n):
        if n == 0: return 1
        return n * A000023(n-1) + (-2)**n
    [A000023(i) for i in range(23)]   # Peter Luschny, Oct 17 2012
    

Formula

a(n) = Sum_{k=0..n} A008290(n,k)*(-1)^k. - Philippe Deléham, Dec 15 2003
a(n) = Sum_{k=0..n} (-2)^(n-k)*n!/(n-k)! = Sum_{k=0..n} binomial(n, k)*k!*(-2)^(n-k). - Paul Barry, Aug 26 2004
a(n) = exp(-2)*Gamma(n+1,-2) (incomplete Gamma function). - Mark van Hoeij, Nov 11 2009
a(n) = b such that (-1)^n*Integral_{x=0..2} x^n*exp(x) dx = c + b*exp(2). - Francesco Daddi, Aug 01 2011
G.f.: hypergeom([1,k],[],x/(1+2*x))/(1+2*x) with k=1,2,3 is the generating function for A000023, A087981, and A052124. - Mark van Hoeij, Nov 08 2011
D-finite with recurrence: - a(n) + (n-2)*a(n-1) + 2*(n-1)*a(n-2) = 0. - R. J. Mathar, Nov 14 2011
E.g.f.: 1/E(0) where E(k) = 1 - x/(1-2/(2-(k+1)/E(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
G.f.: 1/Q(0), where Q(k) = 1 + 2*x - x*(k+1)/(1 - x*(k+1)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 19 2013
G.f.: 1/Q(0), where Q(k) = 1 - x*(2*k-1) - x^2*(k+1)^2/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Sep 30 2013
a(n) = Sum_{k=0..n} (-1)^(n+k)*binomial(n, k)*!k, where !k is the subfactorial A000166. a(n) = (-2)^n*hypergeom([1, -n], [], 1/2). - Vladimir Reshetnikov, Oct 18 2015
For n >= 3, a(n) = r - (-1)^n mod((-1)^n r, 2^(n - floor((2/n) + log_2(n)))) where r = {n! * e^(-2) - (-2)^(n+1)/(n+1)}. - Stan Wagon, May 02 2016
0 = +a(n)*(+4*a(n+1) -2*a(n+3)) + a(n+1)*(+4*a(n+1) +3*a(n+2) -a(n+3)) +a(n+2)*(+a(n+2)) if n>=0. - Michael Somos, Nov 20 2018
a(n) = KummerU(-n, -n, -2). - Peter Luschny, May 10 2022

A010843 Incomplete Gamma Function at -3.

Original entry on oeis.org

1, -2, 5, -12, 33, -78, 261, -360, 3681, 13446, 193509, 1951452, 23948865, 309740922, 4341155877, 65102989248, 1041690874689, 17708615729550, 318755470552389, 6056352778233924, 121127059051462881, 2543668229620367298
Offset: 1

Views

Author

Keywords

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, Tenth Printing, 1972, p. 262.

Crossrefs

Programs

  • Maple
    a := n -> n!*add(((-3)^(k)/k!), k=0..n): seq(a(n), n=0..21); # Zerinvary Lajos, Jun 22 2007
    seq(simplify(KummerU(-n, -n, -3)), n = 0..21); # Peter Luschny, May 10 2022
  • Mathematica
    Table[ Gamma[ n, -3 ]*E^(-3), {n, 1, 24} ] (* corrected by Peter Luschny, Oct 17 2012 *)
    a[n_] := (-1)^n x D[1/x Exp[x], {x, n}] x^n Exp[-x]
    Table[a[n] /. x -> 3, {n, 0, 20}] (* Gerry Martens , May 05 2016 *)
  • PARI
    a(n)=if(n<0,0,n!*polcoeff(exp(-3*x+x*O(x^n))/(1-x),n)) /*  Michael Somos, Mar 06 2004 */
    
  • PARI
    a(n)=local(A,p);if(n<1,n==0,A=matrix(n,n,i,j,1-3*(i==j));sum(i=1,n!,if(p=numtoperm(n,i),prod(j=1,n,A[j,p[j]])))) /* Michael Somos, Mar 06 2004 */
    
  • Sage
    @CachedFunction
    def A010843(n):
        if (n) == 1 : return 1
        return (n-1)*A010843(n-1)+(-3)^(n-1)
    [A010843(i) for i in (1..22)]    # Peter Luschny, Oct 17 2012

Formula

E.g.f.: exp(-3x)/(1-x). - Michael Somos, Mar 06 2004
a(0) = 1 and for n>0, a(n) is the permanent of the n X n matrix with -2's on the diagonal and 1's elsewhere. a(n) = Sum(k=0..n, A008290(n, k)*(-2)^k ). a(n) = Sum(k=0..n, A008279(n, k)*(-3)^(n-k) ). - Philippe Deléham, Dec 15 2003
G.f.: hypergeom([1,1],[],x/(1+3*x))/(1+3*x). - Mark van Hoeij, Nov 08 2011
E.g.f.: 1/E(0) where E(k)=1-x/(1-3/(3-(k+1)/E(k+1))); (continued fraction). - Sergei N. Gladkovskii, Sep 13 2012
G.f.: 1/Q(0), where Q(k)= 1 + 3*x - x*(k+1)/(1-x*(k+1)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 18 2013
G.f.: 1/Q(0), where Q(k) = 1 - x*(2*k-2) - x^2*(k+1)^2/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Sep 30 2013
a(n) ~ n! * exp(-3). - Vaclav Kotesovec, Oct 08 2013
a(n) = (-3)^(n-1)*hypergeom([1, 1-n], [], 1/3). - Vladimir Reshetnikov, Oct 18 2015
a(n) = KummerU(-n, -n, -3). - Peter Luschny, May 10 2022

A080955 Square array of numbers related to the incomplete gamma function, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 5, 6, 1, 4, 10, 16, 24, 1, 5, 17, 38, 65, 120, 1, 6, 26, 78, 168, 326, 720, 1, 7, 37, 142, 393, 872, 1957, 5040, 1, 8, 50, 236, 824, 2208, 5296, 13700, 40320, 1, 9, 65, 366, 1569, 5144, 13977, 37200, 109601, 362880, 1, 10, 82, 538, 2760, 10970, 34960, 100026
Offset: 0

Views

Author

Paul Barry, Feb 26 2003

Keywords

Examples

			Array begins:
k=0: 1 1 2 6 24 ...
k=1: 1 2 5 16 65 ...
k=2: 1 3 10 38 168 ...
k=3: 1 4 17 78 393 ...
k=4: 1 5 26 142 824 ...
...
		

Crossrefs

Transposed version: A089258.

Programs

  • Mathematica
    T[0, k_] := k!; T[n_, k_] := k!*Sum[n^j/j!, {j, 0, k}];
    Table[T[n-k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 17 2018 *)

Formula

T(k,n) = n! * Sum{j=0..n} k^j/j!.
E.g.f. of k-th row: exp(k*x)/(1-x).
T(k,n) = A089258(n,k).

Extensions

Corrected by Philippe Deléham, Dec 12 2003

A300480 Rectangular array read by antidiagonals: a(m,n) = 2 * Integral_{t>=0} T_n((t+m)/2)*exp(-t)*dt, m>=0, n>=0, where T_n(x) is n-th Chebyshev polynomial of first kind.

Original entry on oeis.org

2, 2, 1, 2, 2, 0, 2, 3, 3, 3, 2, 4, 8, 10, 18, 2, 5, 15, 29, 47, 95, 2, 6, 24, 66, 130, 256, 592, 2, 7, 35, 127, 327, 697, 1610, 4277, 2, 8, 48, 218, 722, 1838, 4376, 11628, 35010, 2, 9, 63, 345, 1423, 4459, 11770, 31607, 95167, 320589, 2, 10, 80, 514, 2562, 9820, 30248, 85634, 258690
Offset: 0

Views

Author

Max Alekseyev, Mar 06 2018

Keywords

Comments

a(m,n) is a polynomial in m of degree n.
For any integers m>=0, n>=0, 2 * Integral_{t=-m..m} T_n(t/2)*exp(-t)*dt = 4 * Integral_{z=-m/2..m/2} T_n(z)*exp(-2*z)*dz = A300481(m,n)*exp(m) - a(m,n)*exp(-m).

Examples

			Array starts with:
m=0: 2,  1,   0,    3,    18,     95,     592, ...
m=1: 2,  2,   3,   10,    47,    256,    1610, ...
m=2: 2,  3,   8,   29,   130,    697,    4376, ...
m=3: 2,  4,  15,   66,   327,   1838,   11770, ...
m=4: 2,  5,  24,  127,   722,   4459,   30248, ...
...
		

Crossrefs

Values for m<=0 are given in A300481.
Rows: A300482 (m=0), A300483 (m=1), A300484 (m=2), A300485 (m=-1), A102761 (m=-2).
Columns: A007395 (n=0), A000027 (n=1), A005563 (n=2), A084380 (n=3).
Cf. A000179 (almost row m=-2), A127672, A156995.

Programs

  • PARI
    { A300480(m,n) = if(n==0,return(2)); subst( serlaplace( 2*polchebyshev(n,1,(x+m)/2)), x, 1); }

Formula

a(m,n) = Sum_{i=0..n} A127672(n,i) * i! * Sum_{j=0..i} m^j/j!.
a(m,n) = Sum_{i=0..n} A127672(n,i) * A080955(m,i) = Sum_{i=0..n} A127672(n,i) * A089258(i,m).

A217701 Permanent of the n X n matrix with all diagonal entries n and all off diagonal entries 1.

Original entry on oeis.org

1, 1, 5, 38, 393, 5144, 81445, 1512720, 32237681, 775193984, 20759213061, 612623724800, 19751688891385, 690721009155072, 26039042401938917, 1052645311044368384, 45424010394042998625, 2083972769418997760000, 101288683106200561501189, 5199006109868903819575296
Offset: 0

Views

Author

Jim Pitman, Mar 19 2013

Keywords

Comments

a(n) is the number of terms that appear before cancellations occur in the evaluation of the determinant of an n X n matrix by the usual sum over permutations of [n], for a matrix whose off diagonal entries are specified, and each of whose diagonal entries is minus the sum of the negatives of the off diagonal entries and one additional term, as in the usual presentation of the matrix in the Matrix Tree Theorem.
The number a(n-1) - n^(n-2) (A000272) is the number of terms which cancel in Zeilberger's proof of the Matrix Tree Theorem. This number is even, as the terms which cancel are equal in magnitude with opposite sign, and as is also apparent from the formula in terms of A087981(n) which is a corollary of Zeilberger's proof.
Formula involves the derangement numbers A000166 which count permutations with no fixed points, also the number A087981 of colored permutations with no fixed points of n elements where each cycle is one of two colors.
Number of permutations of [n] where the fixed points are n-colored and all other points are unicolored. - Alois P. Heinz, Apr 23 2020

Crossrefs

Also closely related to A058127.
Main diagonal of A089258.
Cf. A176043.

Programs

  • Maple
    a:= n-> n!*coeff(series(exp((n-1)*x)/(1-x), x, n+1), x, n):
    seq(a(n), n=0..23);  # Alois P. Heinz, Apr 23 2020
    # second Maple program:
    b:= proc(n, k) option remember; `if`(n<1, 1-n,
          (n+k-1)*b(n-1, k)+(k-1)*(1-n)*b(n-2, k))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..23);  # Alois P. Heinz, Apr 23 2020
    # third Maple program:
    b:= proc(n, k) option remember;
          `if`(min(n, k)<0, 0, n*b(n-1, k)+(k-1)^n)
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..23);  # Alois P. Heinz, Apr 23 2020
  • Mathematica
    derange[0,z_]:=1; derange[n_,z_]:= Pochhammer[z,n] - Sum[ Binomial[n,k] z^(n-k) derange[k,z], {k,0,n-1}]; a[n_]:= Sum[ Binomial[n,k] derange[n-k,1] n^k, {k,0,n}] ; a/@ Range[0,10]
    derange[0,z_]:=1; derange[n_,z_]:= Pochhammer[z,n] - Sum[ Binomial[n,k] z^(n-k) derange[k,z], {k,0,n-1}]; a[n_]:= Sum[ Binomial[n,j] derange[n-j,2] (n+1)^(j-1) (n-j+1), {j,0,n}]; a/@ Range[0,10]
    (* Alternative: *)
    a[n_] := Exp[n - 1] Gamma[n + 1, n - 1];
    Table[a[n], {n, 0, 19}]  (* Peter Luschny, Dec 24 2021 *)

Formula

a(n) = Sum_{k=0..n} C(n,k)*D_{n-k}*n^k, where D_n = A000166(n).
a(n) = Sum_{j=0..n} C(n,k)*D_{n-k,2} (n+1)^(j-1) (n-j+1) where D_{n,2} = A087981(n).
a(n) = n! * [x^n] exp((k-1)*x)/(1-x). - Alois P. Heinz, Apr 23 2020
a(n) = exp(n-1)*Gamma(n+1, n-1). - Peter Luschny, Dec 24 2021

Extensions

a(0),a(16)-a(19) from Alois P. Heinz, Apr 23 2020

A292977 Square array A(n,k), n >= 0, k >= 0, read by antidiagonals, where column k is the expansion of e.g.f. exp(-k*x)/(1 - x).

Original entry on oeis.org

1, 1, 1, 1, 0, 2, 1, -1, 1, 6, 1, -2, 2, 2, 24, 1, -3, 5, -2, 9, 120, 1, -4, 10, -12, 8, 44, 720, 1, -5, 17, -34, 33, 8, 265, 5040, 1, -6, 26, -74, 120, -78, 112, 1854, 40320, 1, -7, 37, -138, 329, -424, 261, 656, 14833, 362880, 1, -8, 50, -232, 744, -1480, 1552, -360, 5504, 133496, 3628800
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 27 2017

Keywords

Comments

A(n,k) is the k-th inverse binomial transform of A000142 evaluated at n.
Can be considered as extension of the array A089258 to columns with negative indices via A089258(n,k) = A(n,-k) or, vice versa, A(n,k) = A089258(n,-k). - Max Alekseyev, Mar 06 2018

Examples

			Square array begins:
n=0:    1,   1,   1,    1,     1,      1,  ...
n=1:    1,   0,  -1,   -2,    -3,     -4,  ...
n=2:    2,   1,   2,    5,    10,     17,  ...
n=3:    6,   2,  -2,  -12,   -34,    -74,  ...
n=4:   24,   9,   8,   33,   120,    329,  ...
n=5:  120,  44,   8,  -78,  -424,  -1480,  ...
...
E.g.f. of column k: A_k(x) = 1 + (1 - k)*x/1! +  (k^2 - 2*k + 2)*x^2/2! + (-k^3 + 3*k^2 - 6*k + 6) x^3/3! + (k^4 - 4*k^3 + 12*k^2 - 24*k + 24)*x^4/4! + ...
		

Crossrefs

Columns: A000142 (k=0), A000166 (k=1), A000023 (k=2), A010843 (k=3, with offset 0).
Main diagonal: A134095 (absolute values).

Programs

  • Mathematica
    Table[Function[k, n! SeriesCoefficient[Exp[-k x]/(1 - x), {x, 0, n}]][j - n], {j, 0, 10}, {n, 0, j}] // Flatten
    FullSimplify[Table[Function[k, Exp[-k] Gamma[n + 1, -k]][j - n], {j, 0, 10}, {n, 0, j}]] // Flatten

Formula

T(n, k) = n! * Sum_{j=0..n} (-k)^j/j!. - Max Alekseyev, Mar 06 2018
E.g.f. of column k: exp(-k*x)/(1 - x).

A134558 Array read by antidiagonals, a(n,k) = gamma(n+1,k)*e^k, where gamma(n,k) is the upper incomplete gamma function and e is the exponential constant 2.71828...

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 6, 5, 3, 1, 24, 16, 10, 4, 1, 120, 65, 38, 17, 5, 1, 720, 326, 168, 78, 26, 6, 1, 5040, 1957, 872, 393, 142, 37, 7, 1, 40320, 13700, 5296, 2208, 824, 236, 50, 8, 1, 362880, 109601, 37200, 13977, 5144, 1569, 366, 65, 9, 1, 3628800, 986410, 297856
Offset: 0

Views

Author

Ross La Haye, Jan 22 2008

Keywords

Examples

			Square array begins:
    1,    1,    1,     1,     1,     1,      1, ...
    1,    2,    3,     4,     5,     6,      7, ...
    2,    5,   10,    17,    26,    37,     50, ...
    6,   16,   38,    78,   142,   236,    366, ...
   24,   65,  168,   393,   824,  1569,   2760, ...
  120,  326,  872,  2208,  5144, 10970,  21576, ...
  720, 1957, 5296, 13977, 34960, 81445, 176112, ...
		

Crossrefs

Cf. a(n, 0) = A000142(n); a(n, 1) = A000522(n); a(n, 2) = A010842(n); a(n, 3) = A053486(n); a(n, 4) = A053487(n); a(n, 5) = A080954(n); a(n, 6) = A108869(n); a(1, k) = A000027(k+1); a(2, k) = A002522(k+1); a(n, n) = A063170(n); a(n, n+1) = A001865(n+1); a(n, n+2) = A001863(n+2).
Another version: A089258.
A transposed version: A080955.
Cf. A001113.

Programs

  • Mathematica
    T[n_,k_] := Gamma[n+1, k]*E^k; Table[T[n-k, k], {n, 0, 10}, {k, 0, n}] //Flatten (* Amiram Eldar, Jun 27 2020 *)

Formula

a(n,k) = gamma(n+1,k)*e^k = Sum_{m=0..n} m!*binomial(n,m)*k^(n-m).
a(n,k) = n*a(n-1,k) + k^n for n,k > 0.
E.g.f. (by columns) is e^(kx)/(1-x).
a(n,k) = the binomial transform by columns of a(n,k-1).
Conjecture: a(n,k) is the permanent of the n X n matrix with k+1 on the main diagonal and 1 elsewhere.

Extensions

More terms from Amiram Eldar, Jun 27 2020
Showing 1-7 of 7 results.