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 53 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

A006252 Expansion of e.g.f. 1/(1 - log(1+x)).

Original entry on oeis.org

1, 1, 1, 2, 4, 14, 38, 216, 600, 6240, 9552, 319296, -519312, 28108560, -176474352, 3998454144, -43985078784, 837126163584, -12437000028288, 237195036797184, -4235955315745536, 85886259443020800, -1746536474655406080, 38320721602434017280, -864056965711935974400
Offset: 0

Views

Author

Keywords

Comments

From Michael Somos, Mar 04 2004: (Start)
Stirling transform of a(n+1)=[1,2,4,14,38,...] is A000255(n)=[1,3,11,53,309,...].
Stirling transform of 2*a(n)=[2,2,4,8,28,...] is A052849(n)=[2,4,12,48,240,...].
Stirling transform of a(n)=[1,1,2,4,14,38,216,...] is A000142(n)=[1,2,6,24,120,...].
Stirling transform of a(n-1)=[1,1,1,2,4,14,38,...] is A000522(n-1)=[1,2,5,16,65,...].
Stirling transform of a(n-1)=[0,1,1,2,4,14,38,...] is A007526(n-1)=[0,1,4,15,64,...].
(End)
For n > 0: a(n) = sum of n-th row in triangle A048594. - Reinhard Zumkeller, Mar 02 2014
Coefficients in a factorial series representation of the exponential integral: exp(z)*E_1(z) = Sum_{n >= 0} (-1)^n*a(n)/(z)n, where (z)_n denotes the rising factorial z*(z + 1)*...*(z + n) and E_1(z) = Integrate{t = z..inf} exp(-t)/t dt. See Weninger, equation 6.4. - Peter Bala, Feb 12 2019

References

  • G. Pólya, Induction and Analogy in Mathematics. Princeton Univ. Press, 1954, p. 9.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=1 of A320080.
Cf. A007840.

Programs

  • Haskell
    a006252 0 = 1
    a006252 n = sum $ a048594_row n  -- Reinhard Zumkeller, Mar 02 2014
    
  • Mathematica
    With[{nn=30},CoefficientList[Series[1/(1-Log[1+x]),{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Aug 12 2016 *)
  • PARI
    a(n)=if(n<0,0,n!*polcoeff(1/(1-log(1+x+x*O(x^n))),n))
    
  • PARI
    {a(n)=local(CF=1+x*O(x^n)); for(k=0, n-1, CF=1/((n-k+1)-(n-k)*x+(n-k+1)^2*x*CF)); n!*polcoeff(1+x/(1-x+x*CF), n, x)} /* Paul D. Hanna, Dec 31 2011 */
    
  • PARI
    a_vector(n) = my(v=vector(n+1)); v[1]=1; for(i=1, n, v[i+1]=sum(j=1, i, (-1)^(j-1)*(j-1)!*binomial(i, j)*v[i-j+1])); v; \\ Seiichi Manyama, May 22 2022
    
  • Sage
    def A006252_list(len):
        f, R, C = 1, [1], [1]+[0]*len
        for n in (1..len):
            f *= n
            for k in range(n, 0, -1):
                C[k] = -C[k-1]*((k-1)/(k) if k>1 else 1)
            C[0] = -sum(C[k] for k in (1..n))
            R.append(C[0]*f)
        return R
    print(A006252_list(24)) # Peter Luschny, Feb 21 2016

Formula

a(n) = Sum_{k=0..n} k!*stirling1(n, k). - Vladeta Jovovic, Sep 08 2002
a(n) = D^n(1/(1-x)) evaluated at x = 0, where D is the operator exp(-x)*d/dx. Row sums of A048594. Cf. A007840. - Peter Bala, Nov 25 2011
E.g.f.: 1/(1-log(1+x)) = 1 + x/(1-x + x/(2-x + 4*x/(3-2*x + 9*x/(4-3*x + 16*x/(5-4*x + 25*x/(6-5*x +...)))))), a continued fraction. - Paul D. Hanna, Dec 31 2011
a(n)/n! ~ -(-1)^n / (n * (log(n))^2) * (1 - 2*(1 + gamma)/log(n)), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Jul 01 2018
a(0) = 1; a(n) = Sum_{k=1..n} (-1)^(k-1) * (k-1)! * binomial(n,k) * a(n-k). - Seiichi Manyama, May 22 2022

A001339 a(n) = Sum_{k=0..n} (k+1)! binomial(n,k).

Original entry on oeis.org

1, 3, 11, 49, 261, 1631, 11743, 95901, 876809, 8877691, 98641011, 1193556233, 15624736141, 220048367319, 3317652307271, 53319412081141, 909984632851473, 16436597430879731, 313262209859119579, 6282647653285676001, 132266266384961600021, 2916471173788403280463
Offset: 0

Views

Author

Keywords

Comments

Number of arrangements of {1, 2, ..., n, n + 1} containing the element 1. - Emeric Deutsch, Oct 11 2001
From Thomas Wieder, Oct 21 2004: (Start)
"Also the number of hierarchies with unlabeled elements and labeled levels where the levels are permuted.
"Let l_x denote level x, e.g. l_2 is level 2. Let * denote an element. Then l_1*l_2***l_3** denotes a hierarchy of n = 6 unlabeled elements with one element on level 1, three elements on level 2 and 2 elements on level 3.
"E.g. for n=3 one has a(3) = 11 possible hierarchies: l_1***, l_1**l_2*, l_1*l_2**, l_2**l_1*, l_2*l_1**, l_1*l_2*l_3*, l_3*l_1*l_2*, l_2*l_3*l_1*, l_1*l_3*l_2*, l_2*l_1*l_3*, l_3*l_2*l_1*. See A064618 for the number of hierarchies with labeled elements and labeled levels." (End)
Polynomials in A010027 evaluated at 2.
Also the permanent of any n X n cofactor of an n+1 X n+1 version of J+I other than an n X n version of J + I (that is, a (1, 2) matrix with n - 1 2s, at most one per row and column). - D. G. Rogers, Aug 27 2006
a(n) = number of partitions of [n+1] into lists of sets that are both non-nesting and non-crossing. Non-nesting means that no set is contained in the span (interval from min to max) of another. For example, a(1) counts 12, 1-2, 2-1 and a(2) counts 123, 1-23, 23-1, 3-12, 12-3, 1-2-3, 1-3-2, 2-1-3, 2-3-1, 3-1-2, 3-2-1. - David Callan, Sep 20 2007
Row sums of triangle A137594. - Gary W. Adamson, Jan 28 2008
From Peter Bala, Jul 10 2008: (Start)
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). See A000522 for further properties of difference divisibility sequences.
a(n) equals the sum of the lengths of the paths between a pair of distinct vertices of the complete graph K_(n + 2) on n + 2 vertices [Hassani]. For example, for the complete graph K_4 with vertex set {A,B,C,D} the 5 paths between A and B are AB of length 1, ACB and ADB, both of length 2 and ACDB and ADCB, both of length 3. The sum of the lengths is 1 + 2 + 2 + 3 + 3 = 11 = a(2).
The number of paths between 2 distinct vertices of K_n is equal to A000522(n - 2); the number of simple cycles through a vertex of K_n equals A038154(n - 1).
Recurrence relation: a(0) = 1, a(1) = 3, a(n) = (n+2)*a(n - 1) - (n - 1)*a(n - 2) for n >= 2. The sequence b(n) := n*n! = A001563(n) satisfies the same recurrence with the initial conditions b(0) = 0, b(1) = 1. This leads to the finite continued fraction expansion a(n)/b(n) = 3 - 1/(4 - 2/(5 - 3/(6 - ... - (n - 1)/(n + 2)))), n >= 1.
Limit_{n->oo} a(n)/b(n) = e = 3 - 1/(4 - 2/(5 - 3/(6 - ... - n/((n + 3) - ...)))).
For n >= 1, a(n) = b(n)*(3 - Sum_{k=2..n} 1/(k!*(k - 1)*k)) (see the formula by Deutsch) since the rhs satisfies the above recurrence with the same initial conditions. Hence e = 3 - Sum_{k>=2} 1/(k!*(k - 1)*k).
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 A000522 (r=0), A082030 (r=2), A095000 (r=3) and A095177 (r=4). (End)
Binomial transform of n! Offset 1. a(3) = 11. - Al Hakanson (hawkuu(AT)gmail.com), May 18 2009
Equals eigensequence of a triangle with (1, 2, 3, ...) as the right border and the rest 1's; equivalent to a(n) = [n terms of the sequence (1, 1, 1, ...) followed by (n + 1)] dot [(n + 1) terms of the sequence (1, 1, 3, 11, 245, ...)]. Example: 261 = a(4) = (1, 1, 1, 1, 5) dot (1, 1, 3, 11, 49) = 1 + 1 + 3 + 11 + 245 = 261. - Gary W. Adamson, Jul 24 2010
Number of nonnegative integers which use each digit at most once in base n+1. - Franklin T. Adams-Watters, Oct 02 2011
a(n) is the number of permutations of {1,2,...,n+2} in which there is an increasing contiguous subsequence (ascending run) beginning with 1 and ending with n+2. The number of such permutations with exactly k, 0<=k<=n, elements between the 1 and (n+2) is given by A132159(n,k) whose row sums equal this sequence. See example. - Geoffrey Critzer, Feb 15 2013

Examples

			G.f. = 1 + 3*x + 11*x^2 + 49*x^3 + 261*x^4 + 1631*x^5 + 11743*x^6 + 95901*x^7 + ...
a(2) = 11: {1, 12, 21, 13, 31, 123, 132, 213, 231, 312, 321}.
a(2) = 11 because we have 11 permutations of {1,2,3,4} (written in one line notation) that have an increasing subsequence beginning with 1 and ending with 4: 1,2,3,4; 1,2,4,3; 1,3,4,2; 1,4,2,3; 1,4,3,2; 2,1,3,4; 2,1,4,3; 2,3,1,4; 3,1,2,4; 3,1,4,2; 3,2,1,4. - _Geoffrey Critzer_, Feb 15 2013
		

References

  • A. Hordijk, Markov Decision Chains, pp. 97-103 in Images of SMC Research, 1996, Stichting Mathematisch Centrum, Amsterdam, Netherlands, 1996. See p. 103.
  • 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).
  • W. A. Whitworth, DCC Exercises in Choice and Chance, Stechert, NY, 1945, p. 56, ex. 232.

Crossrefs

a(n) = A000522(n+1) - A000522(n).
First differences of A000522, A007526, A026243, A073591.
Equals (1/2)*A006183(n-2).
Equals A036918(n+1) + 1.
Leftmost column of A276588.
Cf. also A136104.

Programs

  • GAP
    A001339:=List([0..20],n-> Sum([0..n], k-> Factorial(k+1)*Binomial(n,k))); # Muniru A Asiru, Feb 17 2018
    
  • Magma
    [Factorial(n)*(&+[(n-k+1)/Factorial(k): k in [0..n]]): n in [0..20]]; // G. C. Greubel, Jul 15 2019
    
  • Maple
    a:=proc(n) options operator, arrow: factorial(n)*n*(3-(sum(1/(j*(j-1)*factorial(j)), j=2..n))) end proc: 1, seq(a(n),n=1..20); # Emeric Deutsch, Apr 12 2008
    a := n -> hypergeom([2, -n], [], -1); seq(simplify(a(n)), n=0..18); # Peter Luschny, Sep 20 2014
  • Mathematica
    a[n_] := n!*Sum[(k+1)/(n-k)!, {k, 0, n}]; a /@ Range[0, 20] (* Jean-François Alcover, Jul 13 2011 *)
    a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ Exp[x] / (1 - x)^2, {x, 0, n}]] (* Michael Somos, Oct 20 2011 *)
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( exp(x + x * O(x^n)) / (1 - x)^2, n))} /* Michael Somos, Mar 04 2004 */
    
  • PARI
    vector(20, n, n--; n!*sum(k=0,n,(n-k+1)/k!)) \\ G. C. Greubel, Jul 15 2019
    
  • Sage
    [factorial(n)*sum((n-k+1)/factorial(k) for k in (0..n)) for n in (0..20)] # G. C. Greubel, Jul 15 2019

Formula

E.g.f.: exp(x)/(1-x)^2.
a(n) = round(evalf(exp(1)*(n-1)*(n-1)!)) (n>1).
a(n) = floor(n*n!*e) + 1. - Melvin J. Knight (knightmj(AT)juno.com), May 30 2001
a(n) = {e*n*n!} for n > 0, where {x} denotes the nearest integer part. Proposed by Simon Plouffe, March 1993.
The n-th row of array A089900 is the n-th binomial transform of this sequence. The (n+1)-th term of the n-th binomial transform is (n+1)^(n+1), for n >= 0. E.g., the 5th term of the 4th binomial transform is 5^5: [1, 7, 51, 389, 3125, ...]. - Paul D. Hanna, Nov 14 2003
G.f.: Sum_{k>=0} k! * (x / (1 - x))^k. - Michael Somos, Mar 04 2004
a(n) = Sum_{k = 0..n} A046716(n, k)*2^(n-k). - Philippe Deléham, Jun 12 2004
(n-1)*a(n) = n^2*a(n-1)-1. - Vladeta Jovovic, Sep 04 2004
a(n) = Sum_{k=0..n} P(n, k)*(k+1). - Ross La Haye, Aug 28 2005
a(n) = n!*n*(3 - Sum_{j=2..n} 1/(j*(j-1)*j!)) for n>=1. - Emeric Deutsch, Apr 12 2008
a(n) = (a(n-1)^2 + 2 * a(n-2)^2 + a(n-2) * a(n-3) - 4 * a(n-1) * a(n-3)) / (a(n-2) - a(n-3)) if n>1. - Michael Somos, Oct 20 2011
E.g.f.:1/Q(0); Q(k) = 1 - 2*x/(1+x/(2-x-2/(1-x*(k+1)/Q(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Nov 18 2011
G.f.: 1/Q(0), where Q(k) = 1 - x - x*(k+2)/(1 - x*(k+1)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 22 2013
G.f.: Q(0)/x - 1/x, where Q(k) = 1 + (2*k + 1)*x/( 1 - x - 2*x*(1-x)*(k+1)/(2*x*(k+1) + (1-x)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 09 2013
G.f.: (2/x)/G(0) - 1/x, 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.: Q(0)/(2*x) - 1/x, where 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.: W(0)/x - 1/x, where W(k) = 1 - x*(k+1)/( x*(k+2) - 1/(1 - x*(k+1)/( x*(k+1) - 1/W(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Aug 25 2013
a(n) = hypergeometric([2, -n], [], -1). - Peter Luschny, Sep 20 2014
Upper and bottom right terms of the infinite 2 X 2 matrix product_{N=1,2,3,...} [(1,1); (1,N)]. - Gary W. Adamson, Jul 28 2016
a(n) = R(n,n+1,n) where R(x,y,z) is defined to be R(x+1,y,z+1) = R(y,x,x) + R(z,y,z), R(0,y,z+1) = R(z,y,z), R(x+1,y,0) = R(y,x,x), and R(0,y,0) = y. - David M. Cerna, Feb 16 2018
a(n) = (n + 1)!*hypergeom([-n], [-n-1], 1). - Peter Luschny, Nov 02 2018
a(n) = Integral_{x=0..1} (-LambertW(-1,-x/e))^n dx. - Gleb Koloskov, Jul 25 2021
a(n) = KummerU(-n, -n-1, 1). - Peter Luschny, May 10 2022

Extensions

Typo in description in 1995 Encyclopedia of Integer Sequences corrected Mar 15 1997
Link updated by Susanne Wienand, Nov 19 2011

A002104 Logarithmic numbers.

Original entry on oeis.org

0, 1, 3, 8, 24, 89, 415, 2372, 16072, 125673, 1112083, 10976184, 119481296, 1421542641, 18348340127, 255323504932, 3809950977008, 60683990530225, 1027542662934915, 18430998766219336, 349096664728623336, 6962409983976703337, 145841989688186383359, 3201192743180799343844
Offset: 0

Views

Author

Keywords

Comments

Prime p divides a(p+1). - Alexander Adamchuk, Jul 05 2006
Also number of lists of elements from {1,..,n} with (1st element) = (smallest element), where a list means an ordered subset (cf. A000262), see also Haskell program. - Reinhard Zumkeller, Oct 26 2010
a(n+1) = p_n(-1) where p_n(x) is the unique degree-n polynomial such that p_n(k) = A133942(k) for k = 0, 1, ..., n. - Michael Somos, Apr 30 2012
a(n) = A006231(n) + n. - Geoffrey Critzer, Oct 04 2012

Examples

			From _Reinhard Zumkeller_, Oct 26 2010: (Start)
a(3) = #{[1], [1,2], [1,2,3], [1,3], [1,3,2], [2], [2,3], [3]} = 8;
a(4) = #{[1], [1,2], [1,2,3], [1,2,3,4], [1,2,4], [1,2,4,3], [1,3], [1,3,2], [1,3,2,4], [1,3,4], [1,3,4,2], [1,4], [1,4,2], [1,4,2,3], [1,4,3], [1,4,3,2], [2], [2,3], [2,3,4], [2,4], [2,4,3], [3], [3,4], [4]} = 24. (End)
G.f. = x + 3*x^2 + 8*x^3 + 24*x^4 + 89*x^5 + 415*x^6 + 2372*x^7 + ...
		

References

  • J. M. Gandhi, On logarithmic numbers, Math. Student, 31 (1963), 73-83.
  • 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
    import Data.List (subsequences, permutations)
    a002104 = length . filter (\xs -> head xs == minimum xs) .
                       tail . choices . enumFromTo 1
       where choices = concat . map permutations . subsequences
    -- Reinhard Zumkeller, Feb 21 2012, Oct 25 2010
    
  • Maple
    a := proc(n) option remember; ifelse(n < 2, n, n*a(n-1) - (n-1)*a(n-2) + 1) end:
    seq(a(n), n = 0..23); # Peter Luschny, Dec 05 2023
  • Mathematica
    Table[Sum[Sum[m!/k!,{k,0,m}],{m,0,n-1}],{n,1,30}] (* Alexander Adamchuk, Jul 05 2006 *)
    a[n_] = n*(HypergeometricPFQ[{1, 1, 1-n}, {2}, -1]); Table[a[n], {n, 1, 20}] (* Jean-François Alcover, Mar 29 2011 *)
  • PARI
    x='x+O('x^99); concat([0], Vec(serlaplace(-log(1-x)*exp(x)))) \\ Altug Alkan, Dec 17 2017
    
  • PARI
    {a(n) = sum(k=0, n-1, binomial(n, k) * (n-k-1)!)}; /* Michael Somos, May 08 2019 */

Formula

E.g.f.: -log(1 - x) * exp(x).
a(n) = Sum_{k=1..n} Sum_{i=0..n-k} (n-k)!/i!.
a(n) = Sum_{k=1..n} n(n-1)...(n-k+1)/k = A006231(n) + n - Avi Peretz (njk(AT)netvision.net.il), Mar 24 2001
a(n+1) - a(n) = A000522(n).
a(n) = sum{k=0..n-1, binomial(n, k)*(n-k-1)!}, row sums of A111492. - Paul Barry, Aug 26 2004
a(n) = Sum[Sum[m!/k!,{k,0,m}],{m,0,n-1}]. a(n) = Sum[A000522(m),{m,0,n-1}]. - Alexander Adamchuk, Jul 05 2006
For n > 1, the arithmetic mean of the first n terms is a(n-1) + 1. - Franklin T. Adams-Watters, May 20 2010
a(n) = n * 3F1((1,1,1-n); (2); -1). - Jean-François Alcover, Mar 29 2011
Conjecture: a(n) +(-n-1)*a(n-1) +2*(n-1)*a(n-2) +(-n+2)*a(n-3)=0. - R. J. Mathar, Dec 02 2012
From Emanuele Munarini, Dec 16 2017: (Start)
The generating series A(x) = -exp(x)*log(1-x) satisfies the differential equations:
(1-x)*A'(x) - (1-x)*A(x) = exp(x)
(1-x)*A''(x) - (3-2*x)*A'(x) + (2-x)*A(x) = 0.
From the first one, we have the recurrence reported below by R. R. Forberg. From the second one, we have the recurrence conjectured above. (End)
G.f.: conjecture: T(0)*x/(1-2*x)/(1-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
a(n) ~ exp(1)*(n-1)!. - Vaclav Kotesovec, Mar 10 2014
a(n) = n*a(n-1) - (n-1)*a(n-2) + 1, a(0) = 0, a(1) = 1. - Richard R. Forberg, Dec 15 2014
a(n) = A007526(n) + A006231(n+1) - A030297(n). - Anton Zakharov, Sep 05 2016
0 = +a(n)*(+a(n+1) -4*a(n+2) +4*a(n+3) -a(n+4)) +a(n+1)*(+2*a(n+2) -5*a(n+3) +2*a(n+4)) +a(n+2)*(+2*a(n+2) -a(n+3) -a(n+4)) +a(n+3)*(+a(n+3)) for all n>=0. - Michael Somos, May 08 2019
From Peter Bala, Sep 12 2022: (Start)
For n, m >= 0, a(n) - a(n + m) == ( a(1) - a(m) ) (mod m). The sequence {mod(a(1) - a(m+1), m): m >= 1} begins [0, 1, 1, 0, 1, 5, 1, 0, 3, 7, 1, 4, 1, 9, 8, 0, 1, 15, 1, 4, ...].
Conjectures:
1) for n, m >= 0, k >= 2, a(n + m*2^k) - a(n) is divisible by 2^k.
2) for n >= 0, a(n + m*p^k) - a(n) + m*p^(k-1) is divisible by p^k for all positive integers m and k, and for all odd primes p. The particular case n = m = k = 1 is stated in the Comments section by Adamchuk. (End)
a(n) = Integral_{t=0..oo} ((t + 1)^n - 1)/(t*e^t) dt. - Velin Yanev, Apr 13 2024
a(n) = Gamma(n)*(e - ((-1)^n)*Gamma(1 - n, -1)) + hypergeom([1, 1], [2, n + 2], 1)/(n + 1) - polygamma(n) - 1/n + i*Pi for n > 0, where polygamma is the digamma function and the bivariate gamma function is the upper incomplete gamma function. - Velin Yanev, Apr 13 2024

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 27 2001

A061360 Decimal expansion of e/Pi.

Original entry on oeis.org

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

Views

Author

Jason Earls, Jun 07 2001

Keywords

Examples

			0.86525597943226508721777478964608961742874...
		

Crossrefs

Programs

  • Mathematica
    RealDigits[N[E/Pi,200]] (* Vladimir Joseph Stephan Orlovsky, May 27 2010 *)
    RealDigits[E/Pi,10,120][[1]] (* Harvey P. Dale, Sep 29 2023 *)
  • PARI
    { default(realprecision, 20080); x=10*exp(1)/Pi; for (n=0, 20000, d=floor(x); x=(x-d)*10; write("b061360.txt", n, " ", d)); } \\ Harry J. Smith, Jul 21 2009

Formula

Equals -1 + Product_{n>=0} (1 + 1/(A007526(n) + n!*Pi)). - David Ulgenes, Sep 21 2023

Extensions

Edited by N. J. A. Sloane, Sep 18 2008 at the suggestion of R. J. Mathar

A038156 a(n) = n! * Sum_{k=1..n-1} 1/k!.

Original entry on oeis.org

0, 0, 2, 9, 40, 205, 1236, 8659, 69280, 623529, 6235300, 68588311, 823059744, 10699776685, 149796873604, 2246953104075, 35951249665216, 611171244308689, 11001082397556420, 209020565553571999, 4180411311071440000, 87788637532500240021, 1931350025715005280484
Offset: 0

Views

Author

Keywords

Comments

Related to number of operations of addition and multiplication to evaluate a determinant of order n by cofactor expansion - see A026243.
Also number of operations needed to create all permutations of n distinct elements using Algorithm L (lexicographic permutation generation) from Knuth's The Art of Computer Programming, Vol. 4, chapter 7.2.1.2. Sequence gives number of comparisons required to find j in step L2 (see answer to exercise 5). - Hugo Pfoertner, Jan 24 2003
For n>1, the number of possible ballots where there are n candidates and voters may identify their top m most preferred ones, where 0 < m < n. - Shaye Horwitz, Jun 28 2011
For n > 1, a(n) is the expected number of comparisons required to sort a random list of n distinct elements using the "bogosort" algorithm. - Andrew Slattery, Jun 02 2022
The number of permutations of all proper nonempty subsets of an n element set. - P. Christopher Staecker, May 09 2024

Examples

			a(2) = floor((2.718... - 1)*2) - 1 = 3 - 1 = 2,
a(3) = floor((2.718... - 1)*6) - 1 = 10 - 1 = 9.
		

References

  • D. E. Knuth: The Art of Computer Programming, Volume 4, Fascicle 2. Generating All Tuples and Permutations, Addison-Wesley, 2005.

Crossrefs

Programs

Formula

a(n) = floor((e-1)*n!) - 1.
a(0) = a(1) = 0, a(n) = n*(a(n-1) + 1) for n>1. - Philippe Deléham, Oct 16 2009
E.g.f.: (exp(x) - 1)*x/(1 - x). - Ilya Gutkovskiy, Jan 26 2017
a(n) = A002627(n)-1, n>=1. - R. J. Mathar, Jan 03 2018
a(n) = A000522(n)-n!-1, n>=1. - P. Christopher Staecker, May 09 2024

Extensions

a(28) ff. corrected by Georg Fischer, Apr 11 2020

A033540 a(n+1) = n*(a(n) + 1) for n >= 1, a(1) = 1.

Original entry on oeis.org

1, 2, 6, 21, 88, 445, 2676, 18739, 149920, 1349289, 13492900, 148421911, 1781062944, 23153818285, 324153456004, 4862301840075, 77796829441216, 1322546100500689, 23805829809012420, 452310766371235999, 9046215327424720000, 189970521875919120021
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • GAP
    a:=[1,2,6];; for n in [4..30] do a[n]:=(n+1)*a[n-1]-(2*n-3)*a[n-2] +(n-3)*a[n-3]; od; a; # G. C. Greubel, Oct 13 2019
  • Magma
    I:=[1,2,6]; [n le 3 select I[n] else (n+1)*Self(n-1)-(2*n-3)*Self(n-2)+(n-3)*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jun 21 2014
    
  • Maple
    seq(coeff(series( (1+x*exp(x))/(1-x), x, n+1)*n!, x, n), n = 0..30); # G. C. Greubel, Oct 13 2019
    # second Maple program:
    a:= proc(n) option remember;
          `if`(n=1, 1, (n-1)*(a(n-1)+1))
        end:
    seq(a(n), n=1..23);  # Alois P. Heinz, May 12 2021
  • Mathematica
    FoldList[#1*#2 + #2 &, 1, Range[19]] (* Robert G. Wilson v, Jul 07 2012 *)
    nxt[{a_,n_}]:={n(a+1),n+1}; Transpose[NestList[nxt,{1,1},20]][[1]] (* Harvey P. Dale, Jun 20 2014 *)
  • PARI
    my(x='x+O('x^30)); Vec(serlaplace( (1+x*exp(x))/(1-x) )) \\ G. C. Greubel, Oct 13 2019
    
  • Sage
    [factorial(n)*( (1+x*exp(x))/(1-x) ).series(x,n+1).list()[n] for n in (0..30)] # G. C. Greubel, Oct 13 2019
    

Formula

a(n) = n!*(1 +1/0! +1/1! +...+ 1/(n-1)!). - Jon Bentley (jlb(AT)research.bell-labs.com)
For n>=1, a(n+1) = floor((1+e)*n!) - 1. - Benoit Cloitre, Sep 07 2002
From Vladeta Jovovic, Feb 02 2003: (Start)
a(n) = n! + A007526(n).
E.g.f.: (1+x*exp(x))/(1-x). (End)
a(n) = (n+1)*a(n-1) - (2*n-3)*a(n-2) + (n-3)*a(n-3) for n>=4. - Jaume Oliver Lafont, Sep 11 2009
a(n) = n! + floor(e*n!) - 1, n>0. - Gary Detlefs, Jun 06 2010

A066534 Total number of walks with length > 0 in the Hasse diagram of a Boolean algebra of order n.

Original entry on oeis.org

0, 1, 6, 30, 152, 840, 5232, 37072, 297600, 2680704, 26812160, 294945024, 3539364864, 46011796480, 644165265408, 9662479226880, 154599668154368, 2628194359738368, 47307498477649920, 898842471080329216
Offset: 0

Views

Author

Peter Bertok (peter(AT)bertok.com), Jan 07 2002

Keywords

Comments

Let P(A) be the power set of an n-element set A. Then a(n) = the total number of ways to add 1 or more elements of A to each element x of P(A) where the elements to add are not elements of x and order of addition is important. - Ross La Haye, Nov 19 2007

Examples

			a(2) = 6 because (2! / 0! * 2^0) + (2! / 1! * 2^1) = 6
		

Crossrefs

Programs

  • Mathematica
    a[ n_ ] := n!Sum[ 2^k/k!, {k, 0, n-1} ]
    Table[n*Gamma[n, 2]*E^2, {n, 0, 19}] (* Ross La Haye, Oct 09 2005 *)

Formula

a(n) = n!*Sum_{i+j= 0} 1/(i!*j!). - Benoit Cloitre, Nov 01 2002
E.g.f.: x*exp(2*x)/(1-x). a(n) = n*(a(n-1)+2^(n-1)). - Vladeta Jovovic, Oct 29 2003
a(n) = Sum_{k=0..n-1} (n! / k!) * 2^k = Sum_{k=0..n-1} P(n, n-k) * 2^k = n! * Sum_{k=0..n-1} 2^k / k! = Sum_{k=1..n} P(n, k) * 2^(n-k) = sum of the n-th row of A090802 from column 1 on = A010842(n) - 2^n = n * A010842(n-1) = binomial transform of A007526 - Ross La Haye, Sep 15 2004
E.g.f.: x/U(0) where U(k) = 1 - 2*x/(2 - 4/(2 + (k+1)/U(k+1))); (continued fraction, 3-step). - Sergei N. Gladkovskii, Oct 18 2012
Conjecture: a(n) + (-n-4)*a(n-1) + 4*(n)*a(n-2) + 4*(-n+2)*a(n-3) = 0. - R. J. Mathar, Dec 04 2012
a(n) ~ n! * exp(2). - Vaclav Kotesovec, Jun 01 2013
Mathar's conjectural third-order recurrence above is an easy consequence of Jovovic's first-order recurrence a(n) = n*(a(n-1) + 2^(n-1)). - Peter Bala, Sep 23 2013

Extensions

Edited by Dean Hickerson, Jan 12 2002
Entry revised by Ross La Haye, Aug 18 2006

A073107 Triangle T(n,k) read by rows, where e.g.f. for T(n,k) is exp((1+y)*x)/(1-x).

Original entry on oeis.org

1, 2, 1, 5, 4, 1, 16, 15, 6, 1, 65, 64, 30, 8, 1, 326, 325, 160, 50, 10, 1, 1957, 1956, 975, 320, 75, 12, 1, 13700, 13699, 6846, 2275, 560, 105, 14, 1, 109601, 109600, 54796, 18256, 4550, 896, 140, 16, 1, 986410, 986409, 493200, 164388, 41076, 8190, 1344, 180, 18, 1
Offset: 0

Views

Author

Vladeta Jovovic, Aug 19 2002

Keywords

Comments

Triangle is second binomial transform of A008290. - Paul Barry, May 25 2006
Ignoring signs, n-th row is the coefficient list of the permanental polynomial of the n X n matrix with 2's along the main diagonal and 1's everywhere else (see Mathematica code below). - John M. Campbell, Jul 02 2012

Examples

			exp((1 + y)*x)/(1 - x) =
  1 +
  1/1! * (2 + y) * x +
  1/2! * (5 + 4*y + y^2) * x^2 +
  1/3! * (16 + 15*y + 6*y^2 + y^3) * x^3 +
  1/4! * (65 + 64*y + 30*y^2 + 8*y^3 + y^4) * x^4 +
  1/5! * (326 + 325*y + 160*y^2 + 50*y^3 + 10*y^4 + y^5) * x^5 + ...
Triangle starts:
  [0]     1;
  [1]     2,     1;
  [2]     5,     4,    1;
  [3]    16,    15,    6,    1;
  [4]    65,    64,   30,    8,   1;
  [5]   326,   325,  160,   50,  10,   1;
  [6]  1957,  1956,  975,  320,  75,  12,  1;
  [7] 13700, 13699, 6846, 2275, 560, 105, 14, 1;
		

Crossrefs

Cf. A008290, A008291, A046802, A093375 (unsigned inverse), A094587, A010842 (row sums), A000142 (alternating row sums), A367963 (central terms).
Column k=0..4 give A000522, A007526, A038155, A357479, A357480.

Programs

  • Maple
    T := (n, k) -> binomial(n,k)*KummerU(k-n, k-n, 1);
    seq(seq(simplify(T(n, k)), k = 0..n), n=0..8);  # Peter Luschny, Oct 16 2024
  • Mathematica
    perm[m_List] := With[{v=Array[x,Length[m]]},Coefficient[Times@@(m.v),Times@@v]] ;
    A[q_] := Array[KroneckerDelta[#1,#2] + 1&,{q,q}] ;
    n = 1 ; Print[{1}]; While[n < 10, Print[Abs[CoefficientList[perm[A[n] - IdentityMatrix[n] * k], k]]]; n++] (* John M. Campbell, Jul 02 2012 *)
    A073107[n_, k_] := If[n == k, 1, Floor[E*(n - k)!]*Binomial[n, k]];
    Table[A073107[n, k], {n, 0, 10}, {k, 0, n}] (* Paolo Xausa, Oct 16 2024 *)
  • SageMath
    def T(n, k):
        return sum(binomial(j,k) * factorial(n) // factorial(j) for j in range(n+1))
    for n in range(8): print([T(n, k) for k in range(n+1)])
    # Peter Luschny, Oct 16 2024

Formula

O.g.f. for k-th column is (1/k!)*Sum_{i >= k} i!*x^i/(1-x)^(i+1).
For n > 0, T(n, 0) = floor(n!*exp(1)) = A000522(n), T(n, 1) = floor(n!*exp(1) - 1) = A007526(n), T(n, 2) = 1/2!*floor(n!*exp(1) - 1 - n) = A038155(n), T(n, 3) = 1/3!*floor(n!*exp(1) - 1 - n - n*(n - 1)), T(n, 4) = 1/4!*floor(n!*exp(1) - 1 - n - n*(n - 1) - n*(n - 1)*(n - 2)), ... .
Row sums give A010842.
E.g.f. for k-th column is (x^k/k!)*exp(x)/(1 - x).
O.g.f. for k-th row is n!*Sum_{k = 0..n} (1 + x)^k/k!.
T(n,k) = Sum_{j = 0..n} binomial(j,k)*n!/j!. - Paul Barry, May 25 2006
-exp(-x) * Sum_{k=0..n} T(n,k)*x^k = Integral (x+1)^n*exp(-x) dx = -exp(1)*Gamma(n+1,x+1). - Gerald McGarvey, Mar 15 2009
From Peter Bala, Sep 20 2012: (Start)
Exponential Riordan array [exp(x)/(1-x),x] belonging to the Appell subgroup, which factorizes in the Appell group as [1/1-x,x]*[exp(x),x] = A094587*A007318.
The n-th row polynomial R(n,x) of the triangle satisfies d/dx(R(n,x)) = n*R(n-1,x), as well as R(n,x + y) = Sum {k = 0..n} binomial(n,k)*R(k,x)*y^(n-k). The row polynomials are a Sheffer sequence of Appell type.
Matrix inverse of triangle is a signed version of A093375. (End)
From Tom Copeland, Oct 20 2015: (Start)
The raising operator, with D = d/dx, for the row polynomials is RP = x + d{log[e^D/(1-D)]}/dD = x + 1 + 1/(1-D) = x + 2 + D + D^2 + ..., i.e., RP R(n,x) = R(n+1,x).
This operator is the limit as t tends to 1 of the raising operator of the polynomials p(n,x;t) described in A046802, implying R(n,x) = p(n,x;1). Compare with the raising operator of A094587, x + 1/(1-D), and that of signed A093375, x - 1 - 1/(1-D).
From the Appell formalism, the row polynomials RI(n,x) of signed A093375 are the umbral inverse of this entry's row polynomials; that is, R(n,RI(.,x)) = x^n = RI(n,R(.,x)) under umbral composition. (End)
From Werner Schulte, Sep 07 2020: (Start)
T(n,k) = (n! / k!) * (Sum_{i=k..n} 1 / (n-i)!) for 0 <= k <= n.
T(n,k) = n * T(n-1,k) + binomial(n,k) for 0 <= k <= n with initial values T(0,0) = 1 and T(i,j) = 0 if j < 0 or j > i.
T(n,k) = A000522(n-k) * binomial(n,k) for 0 <= k <= n. (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2004

A082458 Multiply by 1, add 1, multiply by 2, add 2, etc., starting with 0.

Original entry on oeis.org

0, 0, 1, 2, 4, 12, 15, 60, 64, 320, 325, 1950, 1956, 13692, 13699, 109592, 109600, 986400, 986409, 9864090, 9864100, 108505100, 108505111, 1302061332, 1302061344, 16926797472, 16926797485, 236975164790, 236975164804, 3554627472060, 3554627472075, 56874039553200, 56874039553216
Offset: 0

Views

Author

Vladeta Jovovic, Apr 25 2003

Keywords

Comments

Bisections: A007526 and A038154.

Crossrefs

Cf. A019464 (same, but start with 1), A019465 (start with 2), A019466 (start with 3).
Cf. A019460 .. A019463 & A082448 (similar, but first add, then multiply).

Programs

  • Mathematica
    Module[{a = 0}, Join[{a}, Flatten[Array[{a *= #, a += #} &, 20]]]] (* Paolo Xausa, Oct 24 2024 *)
  • PARI
    a(n)=if(n<2,0,if(n%2,(n+1)/2*(floor(exp(1)*((n-1)/2)!)-1),floor(exp(1)*(n/2)!)-1))
    
  • PARI
    A082458(n,a=0)={for(i=2,n+1,if(bittest(i,0),a+=i\2,a*=i\2));a} \\ M. F. Hasler, Feb 25 2018

Formula

For n>=2, a(2n)=floor(e*n!)-1, a(2*n+1)=(n+1)*(floor(e*n!)-1). - Benoit Cloitre, Apr 28 2003

Extensions

Edited by M. F. Hasler, Feb 25 2018
Showing 1-10 of 53 results. Next