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

A000522 Total number of ordered k-tuples (k=0..n) of distinct elements from an n-element set: a(n) = Sum_{k=0..n} n!/k!.

Original entry on oeis.org

1, 2, 5, 16, 65, 326, 1957, 13700, 109601, 986410, 9864101, 108505112, 1302061345, 16926797486, 236975164805, 3554627472076, 56874039553217, 966858672404690, 17403456103284421, 330665665962404000, 6613313319248080001, 138879579704209680022, 3055350753492612960485, 70273067330330098091156
Offset: 0

Views

Author

Keywords

Comments

Total number of permutations of all subsets of an n-set.
Also the number of one-to-one sequences that can be formed from n distinct objects.
Old name "Total number of permutations of a set with n elements", or the same with the word "arrangements", both sound too much like A000142.
Related to number of operations of addition and multiplication to evaluate a determinant of order n by cofactor expansion - see A026243.
a(n) is also the number of paths (without loops) in the complete graph on n+2 vertices starting at one vertex v1 and ending at another v2. Example: when n=2 there are 5 paths in the complete graph with 4 vertices starting at the vertex 1 and ending at the vertex 2: (12),(132),(142),(1342),(1432) so a(2) = 5. - Avi Peretz (njk(AT)netvision.net.il), Feb 23 2001; comment corrected by Jonathan Coxhead, Mar 21 2003
Also row sums of Table A008279, which can be generated by taking the derivatives of x^k. For example, for y = 1*x^3, y' = 3x^2, y" = 6x, y'''= 6 so a(4) = 1 + 3 + 6 + 6 = 16. - Alford Arnold, Dec 15 1999
a(n) is the permanent of the n X n matrix with 2s on the diagonal and 1s elsewhere. - Yuval Dekel, Nov 01 2003
(A000166 + this_sequence)/2 = A009179, (A000166 - this_sequence)/2 = A009628.
Stirling transform of A006252(n-1) = [1,1,1,2,4,14,38,...] is a(n-1) = [1,2,5,16,65,...]. - Michael Somos, Mar 04 2004
Number of {12,12*,21*}- and {12,12*,2*1}-avoiding signed permutations in the hyperoctahedral group.
a(n) = b such that Integral_{x=0..1} x^n*exp(-x) dx = a-b*exp(-1). - Sébastien Dumortier, Mar 05 2005
a(n) is the number of permutations on [n+1] whose left-to-right record lows all occur at the start. Example: a(2) counts all permutations on [3] except 231 (the last entry is a record low but its predecessor is not). - David Callan, Jul 20 2005
a(n) is the number of permutations on [n+1] that avoid the (scattered) pattern 1-2-3|. The vertical bar means the "3" must occur at the end of the permutation. For example, 21354 is not counted by a(4): 234 is an offending subpermutation. - David Callan, Nov 02 2005
Number of deco polyominoes of height n+1 having no reentrant corners along the lower contour (i.e., no vertical step that is followed by a horizontal step). In other words, a(n)=A121579(n+1,0). A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column. Example: a(1)=2 because the only deco polyominoes of height 2 are the vertical and horizontal dominoes, having no reentrant corners along their lower contours. - Emeric Deutsch, Aug 16 2006
Unreduced numerators of partial sums of the Taylor series for e. - Jonathan Sondow, Aug 18 2006
a(n) is the number of permutations on [n+1] (written in one-line notation) for which the subsequence beginning at 1 is increasing. Example: a(2)=5 counts 123, 213, 231, 312, 321. - David Callan, Oct 06 2006
a(n) is the number of permutations (written in one-line notation) on the set [n + k], k >= 1, for which the subsequence beginning at 1,2,...,k is increasing. Example: n = 2, k = 2. a(2) = 5 counts 1234, 3124, 3412, 4123, 4312. - Peter Bala, Jul 29 2014
a(n) and (1,-2,3,-4,5,-6,7,...) form a reciprocal pair under the list partition transform and associated operations described in A133314. - Tom Copeland, Nov 01 2007
Consider the subsets of the set {1,2,3,...,n} formed by the first n integers. E.g., for n = 3 we have {}, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}. Let the variable sbst denote a subset. For each subset sbst we determine its number of parts, that is nprts(sbst). The sum over all possible subsets is written as Sum_{sbst=subsets}. Then a(n) = Sum_{sbst=subsets} nprts(sbst)!. E.g., for n = 3 we have 1!+1!+1!+1!+2!+2!+2!+3!=16. - Thomas Wieder, Jun 17 2006
Equals row sums of triangle A158359(unsigned). - Gary W. Adamson, Mar 17 2009
Equals eigensequence of triangle A158821. - Gary W. Adamson, Mar 30 2009
For positive n, equals 1/BarnesG(n+1) times the determinant of the n X n matrix whose (i,j)-coefficient is the (i+j)th Bell number. - John M. Campbell, Oct 03 2011
a(n) is the number of n X n binary matrices with i) at most one 1 in each row and column and ii) the subset of rows that contain a 1 must also be the columns that contain a 1. Cf. A002720 where restriction ii is removed. - Geoffrey Critzer, Dec 20 2011
Number of restricted growth strings (RGS) [d(1),d(2),...,d(n)] such that d(k) <= k and d(k) <= 1 + (number of nonzero digits in prefix). The positions of nonzero digits determine the subset, and their values (decreased by 1) are the (left) inversion table (a rising factorial number) for the permutation, see example. - Joerg Arndt, Dec 09 2012
Number of a restricted growth strings (RGS) [d(0), d(1), d(2), ..., d(n)] where d(k) >= 0 and d(k) <= 1 + chg([d(0), d(1), d(2), ..., d(k-1)]) and chg(.) gives the number of changes of its argument. Replacing the function chg(.) by a function asc(.) that counts the ascents in the prefix gives A022493 (ascent sequences). - Joerg Arndt, May 10 2013
The sequence t(n) = number of i <= n such that floor(e*i!) is a square is mentioned in the abstract of Luca & Shparlinski. The values are t(n) = 0 for 0 <= n <= 2 and t(n) = 1 for at least 3 <= n <= 300. - R. J. Mathar, Jan 16 2014
a(n) = p(n,1) = q(n,1), where p and q are polynomials defined at A248664 and A248669. - Clark Kimberling, Oct 11 2014
a(n) is the number of ways at most n people can queue up at a (slow) ticket counter when one or more of the people may choose not to queue up. Note that there are C(n,k) sets of k people who quene up and k! ways to queue up. Since k can run from 0 to n, a(n) = Sum_{k=0..n} n!/(n-k)! = Sum_{k=0..n} n!/k!. For example, if n=3 and the people are A(dam), B(eth), and C(arl), a(3)=16 since there are 16 possible lineups: ABC, ACB, BAC, BCA, CAB, CBA, AB, BA, AC, CA, BC, CB, A, B, C, and empty queue. - Dennis P. Walsh, Oct 02 2015
As the row sums of A008279, Motzkin uses the abbreviated notation $n_<^\Sigma$ for a(n).
The piecewise polynomial function f defined by f(x) = a(n)*x^n/n! on each interval [ 1-1/a(n), 1-1/a(n+1) ) is continuous on [0,1) and lim_{x->1} f(x) = e. - Luc Rousseau, Oct 15 2019
a(n) is composite for 3 <= n <= 2015, but a(2016) is prime (or at least a strong pseudoprime): see Johansson link. - Robert Israel, Jul 27 2020 [a(2016) is prime, ECPP certificate generated with CM 0.4.3 and checked by factordb. - Jason H Parker, Jun 15 2025]
In general, sequences of the form a(0)=a, a(n) = n*a(n-1) + k, n>0, will have a closed form of n!*a + floor(n!*(e-1))*k. - Gary Detlefs, Oct 26 2020
From Peter Bala, Apr 03 2022: (Start)
a(2*n) is odd and a(2*n+1) is even. More generally, a(n+k) == a(n) (mod k) for all n and k. It follows that for each positive integer k, the sequence obtained by reducing a(n) modulo k is periodic, with the exact period dividing k. Various divisibility properties of the sequence follow from this; for example, a(5*n+2) == a(5*n+4) == 0 (mod 5), a(25*n+7) == a(25*n+19) == 0 (mod 25) and a(13*n+4) == a(13*n+10)== a(13*n+12) == 0 (mod 13). (End)
Number of possible ranking options on a typical ranked choice voting ballot with n candidates (allowing undervotes). - P. Christopher Staecker, May 05 2024
From Thomas Scheuerle, Dec 28 2024: (Start)
Number of decorated permutations of size n.
Number of Le-diagrams with bounding box semiperimeter n, for n > 0.
By counting over all k = 1..n and n > 0, the number of positroid cells for the totally nonnegative real Grassmannian Gr(k, n), equivalently the number of Grassmann necklaces of type (k, n). (End)

Examples

			G.f. = 1 + 2*x + 5*x^2 + 16*x^3 + 65*x^4 + 326*x^5 + 1957*x^6 + 13700*x^7 + ...
With two objects we can form 5 sequences: (), (a), (b), (a,b), (b,a), so a(2) = 5.
From _Joerg Arndt_, Dec 09 2012: (Start)
The 16 arrangements of the 3-set and their RGS (dots denote zeros) are
  [ #]       RGS        perm. of subset
  [ 1]    [ . . . ]      [  ]
  [ 2]    [ . . 1 ]      [ 3 ]
  [ 3]    [ . 1 . ]      [ 2 ]
  [ 4]    [ . 1 1 ]      [ 2 3 ]
  [ 5]    [ . 1 2 ]      [ 3 2 ]
  [ 6]    [ 1 . . ]      [ 1 ]
  [ 7]    [ 1 . 1 ]      [ 1 3 ]
  [ 8]    [ 1 . 2 ]      [ 3 1 ]
  [ 9]    [ 1 1 . ]      [ 1 2 ]
  [10]    [ 1 1 1 ]      [ 1 2 3 ]
  [11]    [ 1 1 2 ]      [ 1 3 2 ]
  [12]    [ 1 1 3 ]      [ 2 3 1 ]
  [13]    [ 1 2 . ]      [ 2 1 ]
  [14]    [ 1 2 1 ]      [ 2 1 3 ]
  [15]    [ 1 2 2 ]      [ 3 1 2 ]
  [16]    [ 1 2 3 ]      [ 3 2 1 ]
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 75, Problem 9.
  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 65, p. 23, Ellipses, Paris 2008.
  • J. M. Gandhi, On logarithmic numbers, Math. Student, 31 (1963), 73-83.
  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section E11.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 16.
  • D. Singh, The numbers L(m,n) and their relations with prepared Bernoulli and Eulerian numbers, Math. Student, 20 (1952), 66-70.
  • 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

Average of n-th row of triangle in A068424 [Corrected by N. J. A. Sloane, Feb 29 2024].
Row sums of A008279 and A094816.
First differences give A001339. Second differences give A001340.
Partial sums are in A001338, A002104.
A row of the array in A144502.
See also A370973, Nearest integer to e*n!.

Programs

  • Haskell
    import Data.List (subsequences, permutations)
    a000522 = length . choices . enumFromTo 1 where
    choices = concat . map permutations . subsequences
    -- Reinhard Zumkeller, Feb 21 2012, Oct 25 2010
    
  • Magma
    [1] cat [n eq 1 select (n+1) else n*Self(n-1)+1: n in [1..25]]; // Vincenzo Librandi, Feb 15 2015
    
  • Maple
    a(n):= exp(1)*int(x^n*exp(-x)*Heaviside(x-1), x=0..infinity); # Karol A. Penson, Oct 01 2001
    A000522 := n->add(n!/k!,k=0..n);
    G(x):=exp(x)/(1-x): f[0]:=G(x): for n from 1 to 26 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..20);
    # Zerinvary Lajos, Apr 03 2009
    G:=exp(z)/(1-z): Gser:=series(G,z=0,21):
    for n from 0 to 20 do a(n):=n!*coeff(Gser,z,n): end do
    # Paul Weisenhorn, May 30 2010
    k := 1; series(hypergeom([1,k],[],x/(1-x))/(1-x), x=0, 20); # Mark van Hoeij, Nov 07 2011
    # one more Maple program:
    a:= proc(n) option remember;
          `if`(n<0, 0, 1+n*a(n-1))
        end:
    seq(a(n), n=0..23);  # Alois P. Heinz, Sep 13 2019
    seq(simplify(KummerU(-n, -n, 1)), n = 0..23); # Peter Luschny, May 10 2022
  • Mathematica
    Table[FunctionExpand[Gamma[n + 1, 1]*E], {n, 0, 24}]
    nn = 20; Accumulate[Table[1/k!, {k, 0, nn}]] Range[0, nn]! (* Jan Mangaldan, Apr 21 2013 *)
    FoldList[#1*#2 + #2 &, 0, Range@ 23] + 1 (* or *)
    f[n_] := Floor[E*n!]; f[0] = 1; Array[f, 20, 0] (* Robert G. Wilson v, Feb 13 2015 *)
    RecurrenceTable[{a[n + 1] == (n + 1) a[n] + 1, a[0] == 1}, a, {n, 0, 12}] (* Emanuele Munarini, Apr 27 2017 *)
    nxt[{n_,a_}]:={n+1,a(n+1)+1}; NestList[nxt,{0,1},30][[All,2]] (* Harvey P. Dale, Jan 29 2023 *)
  • Maxima
    a(n) := if n=0 then 1 else n*a(n-1)+1; makelist(a(n),n,0,12); /* Emanuele Munarini, Apr 27 2017 */
  • PARI
    {a(n) = local(A); if( n<0, 0, A = vector(n+1); A[1]=1; for(k=1, n, A[k+1] = k*A[k] + 1); A[n+1])}; /* Michael Somos, Jul 01 2004 */
    
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( exp( x +x * O(x^n)) / (1 - x), n))}; /* Michael Somos, Mar 06 2004 */
    
  • PARI
    a(n)=local(A=1+x+x*O(x^n)); for(i=1, n, A=1/(1-x)^2+x^2*deriv(A)/(1-x)); polcoeff(A, n) \\ Paul D. Hanna, Sep 03 2008
    
  • PARI
    {a(n)=local(X=x+x*O(x^n));polcoeff(sum(m=0,n,(m+2)^m*x^m/(1+(m+1)*X)^(m+1)),n)} /* Paul D. Hanna */
    
  • PARI
    a(n)=sum(k=0,n,binomial(n,k)*k!); \\ Joerg Arndt, Dec 14 2014
    
  • Sage
    # program adapted from Alois P. Heinz's Maple code in A022493
    @CachedFunction
    def b(n, i, t):
        if n <= 1:
            return 1
        return sum(b(n - 1, j, t + (j == i)) for j in range(t + 2))
    def a(n):
        return b(n, 0, 0)
    v000522 = [a(n) for n in range(33)]
    print(v000522)
    # Joerg Arndt, May 11 2013
    

Formula

a(n) = n*a(n-1) + 1, a(0) = 1.
a(n) = A007526(n-1) + 1.
a(n) = A061354(n)*A093101(n).
a(n) = n! * Sum_{k=0..n} 1/k! = n! * (e - Sum_{k>=n+1} 1/k!). - Michael Somos, Mar 26 1999
a(0) = 1; for n > 0, a(n) = floor(e*n!).
E.g.f.: exp(x)/(1-x).
a(n) = 1 + Sum_{n>=k>=j>=0} (k-j+1)*k!/j! = a(n-1) + A001339(n-1) = A007526(n) + 1. Binomial transformation of n!, i.e., A000142. - Henry Bottomley, Jun 04 2001
a(n) = floor(2/(n+1))*A009578(n+1)-1. - Emeric Deutsch, Oct 24 2001
Integral representation as n-th moment of a nonnegative function on a positive half-axis: a(n) = e*Integral_{x>=0} x^n*e^(-x)*Heaviside(x-1) dx. - Karol A. Penson, Oct 01 2001
Formula, in Mathematica notation: Special values of Laguerre polynomials, a(n)=(-1)^n*n!*LaguerreL[n, -1-n, 1], n=1, 2, ... . This relation cannot be checked by Maple, as it appears that Maple does not incorporate Laguerre polynomials with second index equal to negative integers. It does check with Mathematica. - Karol A. Penson and Pawel Blasiak ( blasiak(AT)lptl.jussieu.fr), Feb 13 2004
G.f.: Sum_{k>=0} k!*x^k/(1-x)^(k+1). a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(n, k)*k^(n-k)*(k+1)^k. - Vladeta Jovovic, Aug 18 2002
a(n) = Sum_{k=0..n} A008290(n, k)*2^k. - Philippe Deléham, Dec 12 2003
a(n) = Sum_{k=0..n} A046716(n, k). - Philippe Deléham, Jun 12 2004
a(n) = e*Gamma(n+1,1) where Gamma(z,t) = Integral_{x>=t} e^(-x)*x^(z-1) dx is incomplete gamma function. - Michael Somos, Jul 01 2004
a(n) = Sum_{k=0..n} P(n, k). - Ross La Haye, Aug 28 2005
Given g.f. A(x), then g.f. A059115 = A(x/(1-x)). - Michael Somos, Aug 03 2006
a(n) = 1 + n + n*(n-1) + n*(n-1)*(n-2) + ... + n!. - Jonathan Sondow, Aug 18 2006
a(n) = Sum_{k=0..n} binomial(n,k) * k!; interpretation: for all k-subsets (sum), choose a subset (binomial(n,k)), and permutation of subset (k!). - Joerg Arndt, Dec 09 2012
a(n) = Integral_{x>=0} (x+1)^n*e^(-x) dx. - Gerald McGarvey, Oct 19 2006
a(n) = Sum_{k=0..n} A094816(n, k), n>=0 (row sums of Poisson-Charlier coefficient matrix). - N. J. A. Sloane, Nov 10 2007
From Tom Copeland, Nov 01 2007, Dec 10 2007: (Start)
Act on 1/(1-x) with 1/(1-xDx) = Sum_{j>=0} (xDx)^j = Sum_{j>=0} x^j*D^j*x^j = Sum_{j>=0} j!*x^j*L(j,-:xD:,0) where Lag(n,x,0) are the Laguerre polynomials of order 0, D the derivative w.r.t. x and (:xD:)^j = x^j*D^j. Truncating the operator series at the j = n term gives an o.g.f. for a(0) through a(n) consistent with Jovovic's.
These results and those of Penson and Blasiak, Arnold, Bottomley and Deleham are related by the operator A094587 (the reverse of A008279), which is the umbral equivalent of n!*Lag[n,(.)!*Lag[.,x,-1],0] = (1-D)^(-1) x^n = (-1)^n * n! Lag(n,x,-1-n) = Sum_{j=0..n} binomial(n,j)*j!*x^(n-j) = Sum_{j=0..n} (n!/j!)*x^j. Umbral substitution of b(.) for x and then letting b(n)=1 for all n connects the results. See A132013 (the inverse of A094587) for a connection between these operations and 1/(1-xDx).
(End)
From Peter Bala, Jul 15 2008: (Start)
a(n) = n!*e - 1/(n + 1/(n+1 + 2/(n+2 + 3/(n+3 + ...)))).
Asymptotic result (Ramanujan): n!*e - a(n) ~ 1/n - 1/n^3 + 1/n^4 + 2/n^5 - 9/n^6 + ..., where the sequence [1,0,-1,1,2,-9,...] = [(-1)^k*A000587(k)], for k>=1.
a(n) is a difference divisibility sequence, that is, the difference a(n) - a(m) is divisible by n - m for all n and m (provided n is not equal to m). For fixed k, define the derived sequence a_k(n) = (a(n+k)-a(k))/n, n = 1,2,3,... . Then a_k(n) is also a difference divisibility sequence.
For example, the derived sequence a_0(n) is just a(n-1). The set of integer sequences satisfying the difference divisibility property forms a ring with term-wise operations of addition and multiplication.
Recurrence relations: a(0) = 1, a(n) = (n-1)*(a(n-1) + a(n-2)) + 2, for n >= 1. a(0) = 1, a(1) = 2, D-finite with recurrence: a(n) = (n+1)*a(n-1) - (n-1)*a(n-2) for n >= 2. The sequence b(n) := n! satisfies the latter recurrence with the initial conditions b(0) = 1, b(1) = 1. This leads to the finite continued fraction expansion a(n)/n! = 1/(1-1/(2-1/(3-2/(4-...-(n-1)/(n+1))))), n >= 2.
Limit_{n->oo} a(n)/n! = e = 1/(1-1/(2-1/(3-2/(4-...-n/((n+2)-...))))). This is the particular case m = 0 of the general result m!/e - d_m = (-1)^(m+1) *(1/(m+2 -1/(m+3 -2/(m+4 -3/(m+5 -...))))), where d_m denotes the m-th derangement number A000166(m).
For sequences satisfying the more general recurrence a(n) = (n+1+r)*a(n-1) - (n-1)*a(n-2), which yield series acceleration formulas for e/r! that involve the Poisson-Charlier polynomials c_r(-n;-1), refer to A001339 (r=1), A082030 (r=2), A095000 (r=3) and A095177 (r=4).
For the corresponding results for the constants log(2), zeta(2) and zeta(3) refer to A142992, A108625 and A143007 respectively.
(End)
G.f. satisfies: A(x) = 1/(1-x)^2 + x^2*A'(x)/(1-x). - Paul D. Hanna, Sep 03 2008
From Paul Barry, Nov 27 2009: (Start)
G.f.: 1/(1-2*x-x^2/(1-4*x-4*x^2/(1-6*x-9*x^2/(1-8*x-16*x^2/(1-10*x-25*x^2/(1-... (continued fraction);
G.f.: 1/(1-x-x/(1-x/(1-x-2*x/(1-2*x/(1-x-3*x/(1-3*x/(1-x-4*x/(1-4*x/(1-x-5*x/(1-5*x/(1-... (continued fraction).
(End)
O.g.f.: Sum_{n>=0} (n+2)^n*x^n/(1 + (n+1)*x)^(n+1). - Paul D. Hanna, Sep 19 2011
G.f. hypergeom([1,k],[],x/(1-x))/(1-x), for k=1,2,...,9 is the generating function for A000522, A001339, A082030, A095000, A095177, A096307, A096341, A095722, and A095740. - Mark van Hoeij, Nov 07 2011
G.f.: 1/U(0) where U(k) = 1 - x - x*(k+1)/(1 - x*(k+1)/U(k+1)); (continued fraction). - Sergei N. Gladkovskii, Oct 14 2012
E.g.f.: 1/U(0) where U(k) = 1 - x/(1 - 1/(1 + (k+1)/U(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 16 2012
G.f.: 1/(1-x)/Q(0), where Q(k) = 1 - x/(1-x)*(k+1)/(1 - x/(1-x)*(k+1)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, May 19 2013
G.f.: 2/(1-x)/G(0), where G(k) = 1 + 1/(1 - x*(2*k+2)/(x*(2*k+3) - 1 + x*(2*k+2)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 31 2013
G.f.: (B(x)+ 1)/(2-2*x) = Q(0)/(2-2*x), where B(x) be g.f. A006183, Q(k) = 1 + 1/(1 - x*(k+1)/(x*(k+1) + (1-x)/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 08 2013
G.f.: 1/Q(0), where Q(k) = 1 - 2*x*(k+1) - x^2*(k+1)^2/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Sep 30 2013
E.g.f.: e^x/(1-x) = (1 - 12*x/(Q(0) + 6*x - 3*x^2))/(1-x), where Q(k) = 2*(4*k+1)*(32*k^2 + 16*k + x^2 - 6) - x^4*(4*k-1)*(4*k+7)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Nov 18 2013
G.f.: conjecture: T(0)/(1-2*x), where T(k) = 1 - x^2*(k+1)^2/(x^2*(k+1)^2 - (1 - 2*x*(k+1))*(1 - 2*x*(k+2))/T(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Nov 18 2013
0 = a(n)*(+a(n+1) - 3*a(n+2) + a(n+3)) + a(n+1)*(+a(n+1) - a(n+3)) + a(n+2)*(+a(n+2)) for all n>=0. - Michael Somos, Jul 04 2014
From Peter Bala, Jul 29 2014: (Start)
a(n) = F(n), where the function F(x) := Integral_{0..infinity} e^(-u)*(1 + u)^x du smoothly interpolates this sequence to all real values of x. Note that F(-1) = G and for n = 2,3,... we have F(-n) = (-1)^n/(n-1)! *( A058006(n-2) - G ), where G = 0.5963473623... denotes Gompertz's constant - see A073003.
a(n) = n!*e - e*( Sum_{k >= 0} (-1)^k/((n + k + 1)*k!) ).
(End)
a(n) = hypergeometric_U(1, n+2, 1). - Peter Luschny, Nov 26 2014
a(n) ~ exp(1-n)*n^(n-1/2)*sqrt(2*Pi). - Vladimir Reshetnikov, Oct 27 2015
a(n) = A038155(n+2)/A000217(n+1). - Anton Zakharov, Sep 08 2016
a(n) = round(exp(1)*n!), n > 1 - Simon Plouffe, Jul 28 2020
a(n) = KummerU(-n, -n, 1). - Peter Luschny, May 10 2022
a(n) = (e/(2*Pi))*Integral_{x=-oo..oo} (n+1+i*x)!/(1+i*x) dx. - David Ulgenes, Apr 18 2023
Sum_{i=0..n} (-1)^(n-i) * binomial(n, i) * a(i) = n!. - Werner Schulte, Apr 03 2024

Extensions

Additional comments from Michael Somos

A040027 The Gould numbers.

Original entry on oeis.org

1, 1, 3, 9, 31, 121, 523, 2469, 12611, 69161, 404663, 2512769, 16485691, 113842301, 824723643, 6249805129, 49416246911, 406754704841, 3478340425563, 30845565317189, 283187362333331, 2687568043654521, 26329932233283223, 265946395403810289, 2766211109503317451
Offset: 0

Views

Author

Keywords

Comments

Number of permutations beginning with 21 and avoiding 1-23. - Ralf Stephan, Apr 25 2004
Originally defined as main diagonal of an array of binomial recurrence coefficients (see Gould and Quaintance). Also second-from-right diagonal of triangle A121207.
Starting (1, 3, 9, 31, 121, ...) = row sums of triangle A153868. - Gary W. Adamson, Jan 03 2009
Equals eigensequence of triangle A074909 (reflected). - Gary W. Adamson, Apr 10 2009
The divergent series g(x=1,m) = 1^m*1! - 2^m*2! + 3^m*3! - 4^m*4! + ..., m=>-1, is related to the sequence given above. For m=-1 this series dates back to Euler. We discovered that g(x=1,m) = (-1)^m * (A040027(m) - A000110(m+1) * A073003) with A073003 Gompertz's constant and A000110 the Bell numbers, see A163940; A040027(m = -1) = 0. - Johannes W. Meijer, Oct 16 2009
Compare the o.g.f. to the o.g.f. B(x) of the Bell numbers, where B(x) = 1 + x*B(x/(1-x))/(1-x). - Paul D. Hanna, Mar 23 2012
a(n) is the number of set partitions of {1,2,...,n+1} in which the last block is a singleton: the blocks are arranged in order of their least element. An example is given below. - Peter Bala, Dec 17 2014

Examples

			a(3) = 9: Arranging the blocks of the 15 set partitions of {1,2,3,4} in order of their least element we find 9 set partitions for which the last block is a singleton, namely, 123|4, 124|3, 134|2, 1|24|3, 1|23|4, 12|3|4, 13|2|4, 14|2|3, and 1|2|3|4. - _Peter Bala_, Dec 17 2014
		

Crossrefs

Left-hand border of triangle A046936. Cf. also A011971, A014619, A298804.
Cf. A153868. - Gary W. Adamson, Jan 03 2009
Cf. A074909. - Gary W. Adamson, Apr 10 2009
Row sums of A163940. - Johannes W. Meijer, Oct 16 2009
Cf. A108458 (row sums), A124496 (column 1).

Programs

  • Haskell
    a040027 n = head $ a046936_row (n + 1)  -- Reinhard Zumkeller, Jan 01 2014
    
  • Maple
    A040027 := proc(n)
        option remember;
        if n = 0 then
            1;
        else
            add(binomial(n,k-1)*procname(n-k),k=1..n) ;
        end if;
    end proc: # Johannes W. Meijer, Oct 16 2009
  • Mathematica
    a[0] = a[1] = 1; a[n_] := a[n] = Sum[Binomial[n, k + 1]*a[k], {k, 0, n - 1}]; Table[a[n], {n, 0, 22}]  (* Jean-François Alcover, Jul 02 2013 *)
    Rest[CoefficientList[Assuming[Element[x, Reals], Series[E^E^x*(ExpIntegralEi[-E^x] - ExpIntegralEi[-1]), {x, 0, 20}]], x] * Range[0, 20]!] (* Vaclav Kotesovec, Feb 28 2014 *)
  • PARI
    {a(n)=local(A=1+x);for(i=1,n,A=1+x*subst(A,x,x/(1-x+x*O(x^n)))/(1-x)^2);polcoeff(A,n)} /* Paul D. Hanna, Mar 23 2012 */
    
  • Python
    # The function Gould_diag is defined in A121207.
    A040027_list = lambda size: Gould_diag(2, size)
    print(A040027_list(24)) # Peter Luschny, Apr 24 2016

Formula

a(n) = b(n-2), n>1, b(n) = Sum_{k = 1..n} binomial(n, k-1)*b(n-k), b(0) = 1. - Vladeta Jovovic, Apr 28 2001
E.g.f. satisfies A'(x) = exp(x)*A(x)+1. - N. J. A. Sloane
With offset 0, e.g.f.: x + exp(exp(x)) * Integral_{t=0..x} t*exp(-exp(t)+t) dt (fits the recurrence up to n=215). - Ralf Stephan, Apr 25 2004
Recurrence: a(0)=1, a(1)=1, for n > 1, a(n) = n + Sum_{j=1..n-1} binomial(n, j+1)*a(j). - Jon Perry, Apr 26 2005
O.g.f. satisfies: A(x) = 1 + x*A( x/(1-x) ) / (1-x)^2. - Paul D. Hanna, Mar 23 2012
From Peter Bala, Dec 17 2014: (Start)
Starting from A(x) = 1 + O(x) (big Oh notation) we can get a series expansion for the o.g.f. by repeatedly applying the above functional equation of Hanna: A(x) = 1 + O(x) = 1 + x/(1-x)^2 + O(x^2) = 1 + x/(1-x)^2 + x^2/((1-x)*(1-2*x)^2) + O(x^3) = ... = 1 + x/(1-x)^2 + x^2/((1-x)*(1-2*x)^2) + x^3/((1-x)*(1-2*x)*(1-3*x)^2) + x^4/((1-x)*(1-2*x)*(1-3*x)*(1-4*x)^2) + ....
a(n) = Sum_{k = 0..n} ( Sum_{j = k..n} Stirling2(j,k)*k^(n-j) ).
Row sums of A108458. First column of A124496. (End)
Conjecture: a(n) = Sum_{k = 0..n} A058006(k)*A048993(n+1, k+1) - Velin Yanev, Aug 31 2021

Extensions

Entry revised by N. J. A. Sloane, Dec 11 2006
Gould reference updated by Johannes W. Meijer, Aug 02 2009
Don Knuth, Jan 29 2018, suggested that this sequence should be named after H. W. Gould. - N. J. A. Sloane, Jan 30 2018

A073003 Decimal expansion of -exp(1)*Ei(-1), also called Gompertz's constant, or the Euler-Gompertz constant.

Original entry on oeis.org

5, 9, 6, 3, 4, 7, 3, 6, 2, 3, 2, 3, 1, 9, 4, 0, 7, 4, 3, 4, 1, 0, 7, 8, 4, 9, 9, 3, 6, 9, 2, 7, 9, 3, 7, 6, 0, 7, 4, 1, 7, 7, 8, 6, 0, 1, 5, 2, 5, 4, 8, 7, 8, 1, 5, 7, 3, 4, 8, 4, 9, 1, 0, 4, 8, 2, 3, 2, 7, 2, 1, 9, 1, 1, 4, 8, 7, 4, 4, 1, 7, 4, 7, 0, 4, 3, 0, 4, 9, 7, 0, 9, 3, 6, 1, 2, 7, 6, 0, 3, 4, 4, 2, 3, 7
Offset: 0

Views

Author

Robert G. Wilson v, Aug 03 2002

Keywords

Comments

0! - 1! + 2! - 3! + 4! - 5! + ... = (Borel) Sum_{n>=0} (-y)^n n! = KummerU(1,1,1/y)/y.
Decimal expansion of phi(1) where phi(x) = Integral_{t>=0} e^-t/(x+t) dt. - Benoit Cloitre, Apr 11 2003
The divergent series g(x=1,m) = 1^m*1! - 2^m*2! + 3^m*3! - 4^m*4! + ..., m => -1, is intimately related to Gompertz's constant. We discovered that g(x=1,m) = (-1)^m * (A040027(m) - A000110(m+1) * A073003) with A000110 the Bell numbers and A040027 a sequence that was published by Gould, see for more information A163940. - Johannes W. Meijer, Oct 16 2009
Named by Le Lionnais (1983) after the English self-educated mathematician and actuary Benjamin Gompertz (1779 - 1865). It was named the Euler-Gompertz constant by Finch (2003). Lagarias (2013) noted that he has not located this constant in Gompertz's writings. - Amiram Eldar, Aug 15 2020

Examples

			0.59634736232319407434107849936927937607417786015254878157348491...
With n := 10^5, Sum_{k >= 0} (n/(n + 1))^k/(n + k) = 0.5963(51...). - _Peter Bala_, Jun 19 2024
		

References

  • Bruce C. Berndt, Ramanujan's notebooks Part II, Springer, p. 171
  • Bruce C. Berndt, Ramanujan's notebooks Part I, Springer, p. 144-145.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 303, 424-425.
  • Francois Le Lionnais, Les nombres remarquables, Paris: Hermann, 1983. See p. 29.
  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 44, page 426.
  • H. S. Wall, Analytic Theory of Continued Fractions, Van Nostrand, New York, 1948, p. 356.

Crossrefs

Cf. A000522 (arrangements), A001620, A000262, A002720, A002793, A058006 (alternating factorial sums), A091725, A099285, A153229, A201203, A245780, A283743 (Ei(1)/e), A321942, A369883.

Programs

  • Magma
    SetDefaultRealField(RealField(100)); ExponentialIntegralE1(1)*Exp(1); // G. C. Greubel, Dec 04 2018
    
  • Mathematica
    RealDigits[N[-Exp[1]*ExpIntegralEi[-1], 105]][[1]]
    (* Second program: *)
    G = 1/Fold[Function[2*#2 - #2^2/#1], 2, Reverse[Range[10^4]]] // N[#, 105]&; RealDigits[G] // First (* Jean-François Alcover, Sep 19 2014 *)
  • PARI
    eint1(1)*exp(1) \\ Charles R Greathouse IV, Apr 23 2013
    
  • Sage
    numerical_approx(exp_integral_e(1,1)*exp(1), digits=100) # G. C. Greubel, Dec 04 2018

Formula

phi(1) = e*(Sum_{k>=1} (-1)^(k-1)/(k*k!) - Gamma) = 0.596347362323194... where Gamma is the Euler constant.
G = 0.596347... = 1/(1+1/(1+1/(1+2/(1+2/(1+3/(1+3/(1+4/(1+4/(1+5/(1+5/(1+6/(... - Philippe Deléham, Aug 14 2005
Equals A001113*A099285. - Johannes W. Meijer, Oct 16 2009
From Peter Bala, Oct 11 2012: (Start)
Stieltjes found the continued fraction representation G = 1/(2 - 1^2/(4 - 2^2/(6 - 3^2/(8 - ...)))). See [Wall, Chapter 18, (92.7) with a = 1]. The sequence of convergents to the continued fraction begins [1/2, 4/7, 20/34, 124/209, ...]. The numerators are in A002793 and the denominators in A002720.
Also, 1 - G has the continued fraction representation 1/(3 - 2/(5 - 6/(7 - ... -n*(n+1)/((2*n+3) - ...)))) with convergents beginning [1/3, 5/13, 29/73, 201/501, ...]. The numerators are in A201203 (unsigned) and the denominators are in A000262.
(End)
G = f(1) with f solution to the o.d.e. x^2*f'(x) + (x+1)*f(x)=1 such that f(0)=1. - Jean-François Alcover, May 28 2013
From Amiram Eldar, Aug 15 2020: (Start)
Equals Integral_{x=0..1} 1/(1-log(x)) dx.
Equals Integral_{x=1..oo} exp(1-x)/x dx.
Equals Integral_{x=0..oo} exp(-x)*log(x+1) dx.
Equals Integral_{x=0..oo} exp(-x)/(x+1) dx. (End)
From Gleb Koloskov, May 01 2021: (Start)
Equals Integral_{x=0..1} LambertW(e/x)-1 dx.
Equals Integral_{x=0..1} 1+1/LambertW(-1,-x/e) dx. (End)
Equals lim_{n->oo} A040027(n)/A000110(n+1). - Vaclav Kotesovec, Feb 22 2021
G = lim_{n->oo} A321942(n)/A000262(n). - Peter Bala, Mar 21 2022
Equals Sum_{n >= 1} 1/(n*L(n, -1)*L(n-1, -1)), where L(n, x) denotes the n-th Laguerre polynomial. This is the case x = 1 of the identity Integral_{t >= 0} exp(-t)/(x + t) dt = Sum_{n >= 1} 1/(n*L(n, -x)*L(n-1, -x)) valid for Re(x) > 0. - Peter Bala, Mar 21 2024
Equals lim_{n->oo} Sum_{k >= 0} (n/(n + 1))^k/(n + k). Cf. A099285. - Peter Bala, Jun 18 2024

Extensions

Additional references from Gerald McGarvey, Oct 10 2005
Link corrected by Johannes W. Meijer, Aug 01 2009

A133942 a(n) = (-1)^n * n!.

Original entry on oeis.org

1, -1, 2, -6, 24, -120, 720, -5040, 40320, -362880, 3628800, -39916800, 479001600, -6227020800, 87178291200, -1307674368000, 20922789888000, -355687428096000, 6402373705728000, -121645100408832000, 2432902008176640000
Offset: 0

Views

Author

Michael Somos, Sep 30 2007

Keywords

Comments

A variant of A000142, the factorial numbers. - N. J. A. Sloane, Oct 03 2007
The terms of this sequences form the factorial series which Euler called the divergent series par excellence.
Euler summed this series to 0.596347... (A073003 = Gompertz's constant).
Sum_{n>=0} 1/a(n) = 1/e. - Jaume Oliver Lafont, Mar 03 2009
A002104(n+1) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n. - Michael Somos, Apr 30 2012
a(n) = A048594(2*n+1, n+1). - Reinhard Zumkeller, Mar 02 2014
log(1+x) = Sum_{n>=1} a(n-1)/n!*x^n. - James R. Buddenhagen, May 24 2015
It seems that a(n) is the determinant of n+1 X n+1 matrix whose elements are m(i,j) = quotient(i/j) + remainder(i/j). - Andres Cicuttin, Feb 11 2018

Examples

			G.f. = 1 - x + 2*x^2 - 6*x^3 + 24*x^4 - 120*x^5 + 720*x^6 - 5040*x^7 + ...
		

References

  • A. N. Khovanskii. The Application of Continued Fractions and Their Generalizations to Problem in Approximation Theory. Groningen: Noordhoff, Netherlands, 1963. See p. 141 (10.19)
  • R. Roy, Sources in the Development of Mathematics, Cambridge University Press, 2011. See p. 186.

Crossrefs

Partial sums are A058006.
Alternating row sums of A048994.
Also, a(n) = A048994(n+1,1).

Programs

  • GAP
    List([0..20],n->(-1)^n*Factorial(n)); # Muniru A Asiru, Oct 27 2018
  • Haskell
    a133942 n = a133942_list !! n
    a133942_list = zipWith (*) a000142_list $ cycle [1, -1]
    -- Reinhard Zumkeller, Mar 02 2014
    
  • Magma
    [(-1)^n * Factorial(n): n in [0..25]]; // Vincenzo Librandi, May 12 2011
    
  • Maple
    seq((-1)^n*factorial(n),n=0..20); # Muniru A Asiru, Oct 27 2018
  • Mathematica
    nn=20;CoefficientList[Series[1/(1+x),{x,0,nn}],x]Range[0,nn]! (* or *)
    RecurrenceTable[{a[0]==1,a[n]==-n*a[n-1]},a[n],{n,20}] (* Harvey P. Dale, May 10 2011 and slightly modified by Robert G. Wilson v, Feb 12 2018 *)
    a[n_] := (-1)^n*n!; Array[a, 22, 0] (* Robert G. Wilson v, Feb 11 2018 *)
    Times@@@Partition[Riffle[Range[0,30]!,{1,-1}],2] (* Harvey P. Dale, Dec 30 2019 *)
  • PARI
    {a(n) = if( n<0, 0, (-1)^n * n! )};
    
  • Python
    import math
    for n in range(0, 25): print((-1)**n*math.factorial(n), end=', ') # Stefano Spezia, Oct 27 2018
    

Formula

Sum_{i=0..n} (-1)^i * i^n * binomial(n, i) = (-1)^n * n!. - Yong Kong (ykong(AT)curagen.com), Dec 26 2000
Stirling transform of a(n) = [1, -1, 2, -6, 24, ...] is A000007(n) = [1, 0, 0, 0, 0, ...].
a(n) = -n * a(n-1) unless n=0. a(n) = (-1)^n * A000142(n).
E.g.f.: 1/(1 + x).
G.f.: integral(t=1/x,infinity, (e^-t)/t) e^(1/x)/x = 1/(1 + x/(1 + x/(1 + 2*x/(1 + 2*x/(1 + 3*x/(1 + 3*x/(1 + ...))))))).
Convolution inverse of A158882. HANKEL transform is A055209. PSUM transform is A058006. BIN1 transform is A002741(n+1). - Michael Somos, Apr 30 2012
G.f.: 1 - x/(G(0)+x) where G(k) = 1 + (k+1)*x/(1 + x*(k+2)/G(k+1)), G(0) = W(1,1;x)/W(1,2;x), W(a,b,x) = 1 - a*b*x/1! + a*(a+1)*b*(b+1)*x^2/2! - ... + a*(a+1)*...*(a+n-1)*b*(b+1)*...*(b+n-1)*x^n/n! + ...; see [A. N. Khovanskii, p. 141 (10.19)]; (continued fraction, 2-step). - Sergei N. Gladkovskii, Aug 14 2012
G.f.: 1/U(0) where U(k) = 1 + x*(k+1)/(1 + x*(k+1)/U(k+1)); (continued fraction, 2-step). - Sergei N. Gladkovskii, Oct 15 2012
a(n) = (-1)^n*det(S(i+1,j)|, 1 <= i,j <= n), where S(n,k) are Stirling numbers of the second kind. - Mircea Merca, Apr 06 2013
G.f.: 2/G(0), where G(k)= 1 + 1/(1 - 2*x*(k+1)/(2*x*(k+1) + 1 + 2*x*(k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 30 2013
E.g.f.: 1/(1 + x)= G(0), where G(k) = 1 - x*(k+1)*(k+2)/(1 + (k+1)/G(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jan 29 2014
For n >= 1, a(n) = round(zeta^(n)(2)), where zeta^(n) is the n-th derivative of the Riemann zeta function. - Iain Fox, Nov 13 2017
a(n) = (n+1)^(n+1) * Integral_{x=0..1} (x*log(x))^n dx. - Peter James Foreman, Oct 27 2018

A153229 a(0) = 0, a(1) = 1, and for n >= 2, a(n) = (n-1) * a(n-2) + (n-2) * a(n-1).

Original entry on oeis.org

0, 1, 0, 2, 4, 20, 100, 620, 4420, 35900, 326980, 3301820, 36614980, 442386620, 5784634180, 81393657020, 1226280710980, 19696509177020, 335990918918980, 6066382786809020, 115578717622022980, 2317323290554617020, 48773618881154822980, 1075227108896452857020
Offset: 0

Views

Author

Shaojun Ying (dolphinysj(AT)gmail.com), Dec 21 2008

Keywords

Comments

Previous name was: Weighted Fibonacci numbers.
From Peter Bala, Aug 18 2013: (Start)
The sequence occurs in the evaluation of the integral I(n) := Integral_{u >= 0} exp(-u)*u^n/(1 + u) du.
The result is I(n) = A153229(n) + (-1)^n*I(0), where I(0) = Integral_{u >= 0} exp(-u)/(1 + u) du = 0.5963473623... is known as Gompertz's constant. See A073003.
Note also that I(n) = n!*Integral_{u >= 0} exp(-u)/(1 + u)^(n+1) du. (End)
((-1)^(n+1))*a(n) = p(n,-1), where the polynomials p are defined at A248664. - Clark Kimberling, Oct 11 2014

Examples

			a(20) = 19 * a(18) + 18 * a(19) = 19 * 335990918918980 + 18 * 6066382786809020 = 6383827459460620 + 109194890162562360 = 115578717622022980
		

Crossrefs

First differences of A136580.
Column k=0 of A303697 (for n>0).

Programs

  • C
    unsigned long a(unsigned int n) {
    if (n == 0) return 0;
    if (n == 1) return 1;
    return (n - 1) * a(n - 2) + (n - 2) * a(n - 1); }
    
  • Maple
    t1 := sum(n!*x^n, n=0..100): F := series(t1/(1+x), x, 100): for i from 0 to 40 do printf(`%d, `, i!-coeff(F, x, i)) od: # Zerinvary Lajos, Mar 22 2009
    # second Maple program:
    a:= proc(n) a(n):= `if`(n<2, n, (n-1)*a(n-2) +(n-2)*a(n-1)) end:
    seq(a(n), n=0..25); # Alois P. Heinz, May 24 2013
  • Mathematica
    Join[{a = 0}, Table[b = n! - a; a = b, {n, 0, 100}]] (* Vladimir Joseph Stephan Orlovsky, Jun 28 2011 *)
    RecurrenceTable[{a[0]==0,a[1]==1,a[n]==(n-1)a[n-2]+(n-2)a[n-1]},a,{n,30}] (* Harvey P. Dale, May 01 2020 *)
  • PARI
    a(n)=if(n,my(t=(-1)^n);-t-sum(i=1,n-1,t*=-i),0); \\ Charles R Greathouse IV, Jun 28 2011

Formula

a(0) = 0, a(1) = 1, and for n >= 2, a(n) = (n-1) * a(n-2) + (n-2) * a(n-1).
For n>=1, a(n) = A058006(n-1) * (-1)^(n-1).
G.f.: G(0)*x/(1+x)/2, where G(k)= 1 + 1/(1 - x*(k+1)/(x*(k+1) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 24 2013
G.f.: 2*x/(1+x)/G(0), where G(k)= 1 + 1/(1 - 1/(1 - 1/(2*x*(k+1)) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 29 2013
G.f.: W(0)*x/(1+sqrt(x))/(1+x), where W(k) = 1 + sqrt(x)/( 1 - sqrt(x)*(k+1)/(sqrt(x)*(k+1) + 1/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 17 2013
a(n) ~ (n-1)! * (1 - 1/n + 1/n^3 + 1/n^4 - 2/n^5 - 9/n^6 - 9/n^7 + 50/n^8 + 267/n^9 + 413/n^10), where numerators are Rao Uppuluri-Carpenter numbers, see A000587. - Vaclav Kotesovec, Mar 16 2015
E.g.f.: exp(1)/exp(x)*(Ei(1, 1-x)-Ei(1, 1)). - Alois P. Heinz, Jul 05 2018
a(n) = Sum_{k = 0..n-1} (-1)^(n-k-1) * k!. - Peter Bala, Dec 05 2024

Extensions

Edited by Max Alekseyev, Jul 05 2010
Better name by Joerg Arndt, Aug 17 2013

A136580 Row sums of triangle A136579.

Original entry on oeis.org

1, 1, 3, 7, 27, 127, 747, 5167, 41067, 368047, 3669867, 40284847, 482671467, 6267305647, 87660962667, 1313941673647, 21010450850667, 357001369769647, 6423384156578667, 122002101778601647, 2439325392333218667
Offset: 0

Views

Author

Gary W. Adamson, Jan 09 2008

Keywords

Examples

			a(4) = 27 = sum of row 4 terms, triangle A136579: (1 + 0 + 2 + 0 + 24) = 0! + 2! + 4!.
a(5) = 127 = sum of row 5 terms, triangle A136579: (0 + 1 + 0 + 6 + 0 + 120) = 1! + 3! + 5!
G.f. = 1 + x + 3*x^2 + 7*x^3 + 27*x^4 + 127*x^5 + 747*x^6 + 5167*x^7 + 41067*x^8 + ...
		

Crossrefs

Programs

  • Maple
    A136580 := proc(n)
        add( (n-2*i)!,i=0..floor(n/2) ) ;
    end proc: # R. J. Mathar, Jun 04 2021
  • Mathematica
    a[0] = 1; a[1] = 1; a[2] = 3; a[n_] := a[n] = n a[n-1] + a[n-2] - n a[n-3]; Table[a[n], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 29 2015 *)

Formula

G.f.: 2/(1-x^2)/G(0), where G(k)= 1 + 1/(1 - 1/(1 - 1/(2*x*(k+1)) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 29 2013
G.f.: Q(0)/(1-x^2), where Q(k) = 1 - x*(k+1)/( x*(k+1) - 1/(1 - x*(k+1)/( x*(k+1) - 1/Q(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Oct 22 2013
From Vladimir Reshetnikov, Oct 29 2015: (Start):
a(n) = (-1)^n*exp(1)*Gamma(0, 1)/2 - Re(Gamma(0, -1))*exp(-1)/2 + (n+2)!*((-1)^n*Re(Gamma(-n-2, -1))*exp(-1)-Gamma(-n-2, 1)*exp(1))/2, where Gamma(a, x) is the upper incomplete Gamma function.
D-finite with recurrence: a(0) = 1, a(1) = 1, a(2) = 3, a(n) = n*a(n-1) + a(n-2) - n*a(n-3).
E.g.f.: 1/(1-x) + (exp(x-1)*(Ei(1)-Ei(1-x)) + exp(1-x)*(Ei(x-1)-Ei(-1)))/2, where Ei(x) is the exponential integral.
a(n+1)-a(n) = A153229(n+2) = (-1)^(n+1)*A058006(n+1).
(End)
0 = a(n)*(+a(n+1) - a(n+2) - a(n+3) + a(n+4)) + a(n+1)*(+a(n+1) - a(n+2) - 2*a(n+3)) + a(n+2)*(+a(n+2) + a(n+3) - a(n+4)) + a(n+3)*(+a(n+3)) for all n>=0. - Michael Somos, Oct 29 2015

A002793 a(n) = 2n*a(n-1) - (n-1)^2*a(n-2).

Original entry on oeis.org

0, 1, 4, 20, 124, 920, 7940, 78040, 859580, 10477880, 139931620, 2030707640, 31805257340, 534514790680, 9591325648580, 182974870484120, 3697147584561340, 78861451031150840, 1770536585183202980, 41729280102868841080, 1030007496863617367420, 26568602827124392999640
Offset: 0

Views

Author

Keywords

Comments

From Wolfdieter Lang, Dec 12 2011: (Start)
r(n) = a(n+1)*(-1)^n, n >= 0, gives the alternating row sums of the coefficient triangle A199577, i.e., r(n)=La_n(1;0,-1), with the monic first associated Laguerre polynomials with parameter alpha=0 evaluated at x=-1.
The e.g.f. for these row sums r(n) is g(x) = -(2+x)*exp(1/(1+x))*(Ei(1,1/(1+x))-Ei(1,1))/(1+x)^3 + 1/(1+x)^2, with the exponential integral Ei(1,x) = Gamma(0,x).
This e.g.f. satisfies the homogeneous ordinary second-order differential equation (1+x)^2*(d^2/dx^2)g(x) + (6+5*x)*(d/dx)g(x) + 4*g(x) = 0, g(0)=1, (d/dx)g(x)|_{x=0}=-4.
This e.g.f. g(x) is equivalent to the recurrence
b(n)= -2*(n+1)*b(n-1) - n^2*b(n-2), b(-1)=0, b(0)=1.
Therefore, the e.g.f. of a(n) is A(x)=int(g(-x),x), with A(0)=0. This agrees with the e.g.f. given below in the formula section by Max Alekseyev.
(End)

References

  • J. Ser, Les Calculs Formels des Séries de Factorielles. Gauthier-Villars, Paris, 1933, p. 78.
  • 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).
  • H. S. Wall, Analytic Theory of Continued Fractions, Chelsea 1973, p. 356.

Crossrefs

Bisection of A056952. A199577 (alternating row sums, unsigned).

Programs

  • Magma
    I:=[1, 4]; [0] cat [n le 2 select I[n] else 2*n*Self(n-1) - (n-1)^2*Self(n-2): n in [1..30]]; // G. C. Greubel, May 16 2018
  • Mathematica
    Flatten[{0,RecurrenceTable[{(-1+n)^2 a[-2+n]-2 n a[-1+n]+a[n]==0,a[1]==1,a[2]==4}, a, {n, 20}]}] (* Vaclav Kotesovec, Oct 19 2013 *)
    nxt[{n_,a_,b_}]:={n+1,b,2(n+1)b-n^2 a}; NestList[nxt,{1,0,1},30][[All,2]] (* Harvey P. Dale, Sep 06 2022 *)
  • PARI
    A058006(n) = sum(k=0,n, (-1)^k*k! );
    a(n) = if (n<=1, n, sum(k=1, n, (k+1) * A058006(k-1) * binomial(n,k) * (n-1)! / (k-1)! ) ); /* Joerg Arndt, Oct 12 2012 */
    
  • PARI
    {a(n)=if(n==1,1,polcoeff(1-sum(m=1, n-1, a(m)*x^m*(1-(m+1)*x+x*O(x^n))^2), n))} \\ Paul D. Hanna, Feb 06 2013
    

Formula

From Max Alekseyev, Jul 06 2010: (Start)
For n > 1, a(n) = Sum_{k=1..n} (k+1) * A058006(k-1) * binomial(n,k) * (n-1)! / (k-1)!.
E.g.f.: (Gamma(0,1) - Gamma(0,1/(1-x))) * exp(1/(1-x)) / (1-x). (End)
From Peter Bala, Oct 11 2012: (Start)
Numerators in the sequence of convergents of Stieltjes's continued fraction for A073003, the Euler-Gompertz constant G := int {x = 0..oo} 1/(1+x)*exp(-x) dx:
G = 1/(2 - 1^2/(4 - 2^2/(6 - 3^2/(8 - ...)))). See [Wall, Chapter 18, (92.7) with a = 1]. The sequence of convergents to the continued fraction begins [1/2, 4/7, 20/34, 124/209, ...]. The denominators are in A002720.
(End)
G.f.: x = Sum_{n>=1} a(n) * x^n * (1 - (n+1)*x)^2. - Paul D. Hanna, Feb 06 2013
a(n) ~ G * exp(2*sqrt(n) - n - 1/2) * n^(n+1/4) / sqrt(2) * (1 + 31/(48*sqrt(n))), where G = 0.596347362323194... is the Gompertz constant (see A073003). - Vaclav Kotesovec, Oct 19 2013

Extensions

Edited by Max Alekseyev, Jul 13 2010

A176787 a(n) = (0!-1!+2!-3!....(-1)^(n-1)*(n-1)!) mod n.

Original entry on oeis.org

0, 0, 2, 0, 0, 2, 4, 4, 8, 0, 5, 8, 0, 4, 5, 12, 9, 8, 15, 0, 11, 16, 19, 20, 20, 0, 17, 4, 20, 20, 10, 28, 5, 26, 25, 8, 0, 34, 26, 20, 2, 32, 6, 16, 35, 42, 7, 44, 11, 20, 26, 0, 21, 44, 5, 4, 53, 20, 33, 20, 49, 10, 53, 60, 0, 38, 6, 60, 65, 60, 65, 44, 16, 0, 20, 72, 60, 26, 5, 60, 17
Offset: 1

Views

Author

Keywords

Examples

			a(1) = 0! mod 1 = 1 mod 1 = 0;
a(2) = (0!-1!) mod 2 = (1 - 1) mod 2 = 0;
a(3) = (0!-1!+2!) mod 3 = (1 - 1 + 2) mod 3 = 2.
		

Crossrefs

Cf. A049782, A064383 (n such that a(n) is 0).

Programs

Formula

a(n) = A058006(n) mod n. - R. J. Mathar, Jul 13 2012

Extensions

Edited by Johannes W. Meijer, Jun 28 2011

A368561 a(n) = Sum_{k=0..n} k! * n^k.

Original entry on oeis.org

1, 2, 11, 184, 6565, 390806, 34557919, 4237440628, 687219772553, 142347286888210, 36654963132246211, 11483715014356017104, 4300711472638444724653, 1897241450053063830832078, 973695564434830963964311655
Offset: 0

Views

Author

Seiichi Manyama, Dec 30 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = sum(k=0, n, k!*n^k);

Formula

a(n) ~ n! * n^n. - Vaclav Kotesovec, Jan 13 2024

A134316 a(n) = index of first derangement of 1..n (n>=2).

Original entry on oeis.org

2, 4, 8, 28, 128, 748, 5168, 41068, 368048, 3669868, 40284848, 482671468, 6267305648, 87660962668, 1313941673648, 21010450850668, 357001369769648, 6423384156578668, 122002101778601648, 2439325392333218668
Offset: 2

Views

Author

Zak Seidov, Jan 16 2008

Keywords

Examples

			n=2: permutations are
per={{1,2},{2,1}},
per(2)={2,1} is the first derangement, hence a(2)=2;
n=3: permutations are
per={{1,2,3},{1,3,2},{2,1,3},{2,3,1},{3,1,2},{3,2,1}},
per(3)= {2,1,3} is the first derangement, hence a(3)=2;
n=4: permutations are
per={{1,2,3,4},{1,2,4,3},{1,3,2,4},{1,3,4,2},{1,4,2,3},{1,4,3,2},{2,1,3,4},{2,1,4,3},{2,3,1,4},{2,3,4,1},{2,4,1,3},{2,4,3,1},{3,1,2,4},{3,1,4,2},{3,2,1,4},{3,2,4,1},{3,4,1,2},{3,4,2,1},{4,1,2,3},{4,1,3,2},{4,2,1,3},{4,2,3,1},{4,3,1,2},{4,3,2,1}},
per(8)= {2,1,4,3} is the first derangement, hence a(4)=8.
		

Crossrefs

Cf. A058006.

Programs

  • Mathematica
    c[0]=1;c[1]=2;c[n_]:=c[n]=c[n-2]+(n-1)!;A1=Table[c[n],{n,2,20}]

Formula

a(0)=1, a(1)=2, a(n)=a(n-2)+(n-1)!; a(n)=a(n-1)=abs(A058006(n)).
Showing 1-10 of 15 results. Next