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

A008290 Triangle T(n,k) of rencontres numbers (number of permutations of n elements with k fixed points).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 2, 3, 0, 1, 9, 8, 6, 0, 1, 44, 45, 20, 10, 0, 1, 265, 264, 135, 40, 15, 0, 1, 1854, 1855, 924, 315, 70, 21, 0, 1, 14833, 14832, 7420, 2464, 630, 112, 28, 0, 1, 133496, 133497, 66744, 22260, 5544, 1134, 168, 36, 0, 1, 1334961, 1334960, 667485, 222480, 55650, 11088, 1890, 240, 45, 0, 1
Offset: 0

Views

Author

Keywords

Comments

This is a binomial convolution triangle (Sheffer triangle) of the Appell type: (exp(-x)/(1-x),x), i.e., the e.g.f. of column k is (exp(-x)/(1-x))*(x^k/k!). See the e.g.f. given by V. Jovovic below. - Wolfdieter Lang, Jan 21 2008
The formula T(n,k) = binomial(n,k)*A000166(n-k), with the derangements numbers (subfactorials) A000166 (see also the Charalambides reference) shows the Appell type of this triangle. - Wolfdieter Lang, Jan 21 2008
T(n,k) is the number of permutations of {1,2,...,n} having k pairs of consecutive right-to-left minima (0 is considered a right-to-left minimum for each permutation). Example: T(4,2)=6 because we have 1243, 1423, 4123, 1324, 3124 and 2134; for example, 1324 has right-to-left minima in positions 0-1,3-4 and 2134 has right-to-left minima in positions 0,2-3-4, the consecutive ones being joined by "-". - Emeric Deutsch, Mar 29 2008
T is an example of the group of matrices outlined in the table in A132382--the associated matrix for the sequence aC(0,1). - Tom Copeland, Sep 10 2008
A refinement of this triangle is given by A036039. - Tom Copeland, Nov 06 2012
This triangle equals (A211229(2*n,2*k)) n,k >= 0. - Peter Bala, Dec 17 2014

Examples

			exp((y-1)*x)/(1-x) = 1 + y*x + (1/2!)*(1+y^2)*x^2 + (1/3!)*(2 + 3*y + y^3)*x^3 + (1/4!)*(9 + 8*y + 6*y^2 + y^4)*x^4 + (1/5!)*(44 + 45*y + 20*y^2 + 10*y^3 + y^5)*x^5 + ...
Triangle begins:
       1
       0      1
       1      0     1
       2      3     0     1
       9      8     6     0    1
      44     45    20    10    0    1
     265    264   135    40   15    0   1
    1854   1855   924   315   70   21   0  1
   14833  14832  7420  2464  630  112  28  0 1
  133496 133497 66744 22260 5544 1134 168 36 0 1
...
From _Peter Bala_, Feb 13 2017: (Start)
The infinitesimal generator has integer entries given by binomial(n,k)*(n-k-1)! for n >= 2 and 0 <= k <= n-2 and begins
   0
   0  0
   1  0  0
   2  3  0  0
   6  8  6  0 0
  24 30 20 10 0 0
...
It is essentially A238363 (unsigned and omitting the main diagonal), A211603 (with different offset) and appears to be A092271, again without the main diagonal. (End)
		

References

  • Ch. A. Charalambides, Enumerative Combinatorics, Chapman & Hall/CRC, Boca Raton, Florida, 2002, p. 173, Table 5.2 (without row n=0 and column k=0).
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 194.
  • Arnold Kaufmann, Introduction à la combinatorique en vue des applications, Dunod, Paris, 1968. See p. 92.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 65.

Crossrefs

Mirror of triangle A098825.
Cf. A080955.
Cf. A000012, A000142 (row sums), A000354.
Cf. A170942. Sub-triangle of A211229.
T(2n,n) gives A281262.

Programs

  • Haskell
    a008290 n k = a008290_tabl !! n !! k
    a008290_row n = a008290_tabl !! n
    a008290_tabl = map reverse a098825_tabl
    -- Reinhard Zumkeller, Dec 16 2013
  • Maple
    T:= proc(n,k) T(n, k):= `if`(k=0, `if`(n<2, 1-n, (n-1)*
          (T(n-1, 0)+T(n-2, 0))), binomial(n, k)*T(n-k, 0))
        end:
    seq(seq(T(n, k), k=0..n), n=0..12);  # Alois P. Heinz, Mar 15 2013
  • Mathematica
    a[0] = 1; a[1] = 0; a[n_] := Round[n!/E] /; n >= 1 size = 8; Table[Binomial[n, k]a[n - k], {n, 0, size}, {k, 0, n}] // TableForm (* Harlan J. Brothers, Mar 19 2007 *)
    T[n_, k_] := Subfactorial[n-k]*Binomial[n, k]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 12 2017 *)
    T[n_, k_] := If[n<1, Boole[n==0 && k==0], T[n, k] = T[n-1, k-1] + T[n-1, k]*(n-1-k) + T[n-1, k+1]*(k+1)]; (* Michael Somos, Sep 13 2024 *)
    T[0, 0]:=1; T[n_, 0]:=T[n, 0]=n  T[n-1, 0]+(-1)^n; T[n_, k_]:=T[n, k]=n/k T[n-1, k-1];
    Flatten@Table[T[n, k], {n, 0, 9}, {k, 0, n}] (* Oliver Seipel, Nov 26 2024 *)
  • PARI
    {T(n, k) = if(k<0 || k>n, 0, n!/k! * sum(i=0, n-k, (-1)^i/i!))}; /* Michael Somos, Apr 26 2000 */
    

Formula

T(n, k) = T(n-1, k)*n + binomial(n, k)*(-1)^(n-k) = T(n, k-1)/k + binomial(n, k)*(-1)^(n-k)/(n-k+1) = T(n-1, k-1)*n/k = T(n-k, 0)*binomial(n, k) = A000166(n-k)*binomial(n,k) [with T(0, 0) = 1]; so T(n, n) = 1, T(n, n-1) = 0, T(n, n-2) = n*(n-1)/2 for n >= 0.
Sum_{k=0..n} T(n, k) = Sum_{k=0..n} k * T(n, k) = n! for all n > 0, n, k integers. - Wouter Meeussen, May 29 2001
From Vladeta Jovovic, Aug 12 2002: (Start)
O.g.f. for k-th column: (1/k!)*Sum_{i>=k} i!*x^i/(1+x)^(i+1).
O.g.f. for k-th row: k!*Sum_{i=0..k} (-1)^i/i!*(1-x)^i. (End)
E.g.f.: exp((y-1)*x)/(1-x). - Vladeta Jovovic, Aug 18 2002
E.g.f. for number of permutations with exactly k fixed points is x^k/(k!*exp(x)*(1-x)). - Vladeta Jovovic, Aug 25 2002
Sum_{k=0..n} T(n, k)*x^k is the permanent of the n X n matrix with x's on the diagonal and 1's elsewhere; for x = 0, 1, 2, 3, 4, 5, 6 see A000166, A000142, A000522, A010842, A053486, A053487, A080954. - Philippe Deléham, Dec 12 2003; for x = 1+i see A009551 and A009102. - John M. Campbell, Oct 11 2011
T(n, k) = Sum_{j=0..n} A008290(n, j)*k^(n-j) is the permanent of the n X n matrix with 1's on the diagonal and k's elsewhere; for k = 0, 1, 2 see A000012, A000142, A000354. - Philippe Deléham, Dec 13 2003
T(n,k) = Sum_{j=0..n} (-1)^(j-k)*binomial(j,k)*n!/j!. - Paul Barry, May 25 2006
T(n,k) = (n!/k!)*Sum_{j=0..n-k} ((-1)^j)/j!, 0 <= k <= n. From the Appell type of the triangle and the subfactorial formula.
T(n,0) = n*Sum_{j=0..n-1} (j/(j+1))*T(n-1,j), T(0,0)=1. From the z-sequence of this Sheffer triangle z(j)=j/(j+1) with e.g.f. (1-exp(x)*(1-x))/x. See the W. Lang link under A006232 for Sheffer a- and z-sequences. - Wolfdieter Lang, Jan 21 2008
T(n,k) = (n/k)*T(n-1,k-1) for k >= 1. See above. From the a-sequence of this Sheffer triangle a(0)=1, a(n)=0, n >= 1 with e.g.f. 1. See the W. Lang link under A006232 for Sheffer a- and z-sequences. - Wolfdieter Lang, Jan 21 2008
From Henk P. J. van Wijk, Oct 29 2012: (Start)
T(n,k) = T(n-1,k)*(n-1-k) + T(n-1,k+1)*(k+1) for k=0 and
T(n,k) = T(n-1,k-1) + T(n-1,k)*(n-1-k) + T(n-1,k+1)*(k+1) for k>=1.
(End)
T(n,k) = A098825(n,n-k). - Reinhard Zumkeller, Dec 16 2013
Sum_{k=0..n} k^2 * T(n, k) = 2*n! if n > 1. - Michael Somos, Jun 06 2017
From Tom Copeland, Jul 26 2017: (Start)
The lowering and raising operators of this Appell sequence of polynomials P(n,x) are L = d/dx and R = x + d/dL log[exp(-L)/(1-L)] = x-1 + 1/(1-L) = x + L + L^2 - ... such that L P(n,x) = n P(n-1,x) and R P(n,x) = P(n+1,x).
P(n,x) = (1-L)^(-1) exp(-L) x^n = (1+L+L^2+...)(x-1)^n = n! Sum_{k=0..n} (x-1)^k / k!.
The formalism of A133314 applies to the pair of entries A008290 and A055137.
The polynomials of this pair P_n(x) and Q_n(x) are umbral compositional inverses; i.e., P_n(Q.(x)) = x^n = Q_n(P.(x)), where, e.g., (Q.(x))^n = Q_n(x).
For more on the infinitesimal generator, noted by Bala below, see A238385. (End)
Sum_{k=0..n} k^m * T(n,k) = A000110(m)*n! if n >= m. - Zhujun Zhang, May 24 2019
Sum_{k=0..n} (k+1) * T(n,k) = A098558(n). - Alois P. Heinz, Mar 11 2022
From Alois P. Heinz, May 20 2023: (Start)
Sum_{k=0..n} (-1)^k * T(n,k) = A000023(n).
Sum_{k=0..n} (-1)^k * k * T(n,k) = A335111(n). (End)
T(n,k) = A145224(n,k)+A145225(n,k), refined by even and odd perms. - R. J. Mathar, Jul 06 2023

Extensions

Comments and more terms from Michael Somos, Apr 26 2000 and Christian G. Bower, Apr 26 2000

A000179 Ménage numbers: a(0) = 1, a(1) = -1, and for n >= 2, a(n) = number of permutations s of [0, ..., n-1] such that s(i) != i and s(i) != i+1 (mod n) for all i.

Original entry on oeis.org

1, -1, 0, 1, 2, 13, 80, 579, 4738, 43387, 439792, 4890741, 59216642, 775596313, 10927434464, 164806435783, 2649391469058, 45226435601207, 817056406224416, 15574618910994665, 312400218671253762, 6577618644576902053, 145051250421230224304, 3343382818203784146955, 80399425364623070680706, 2013619745874493923699123
Offset: 0

Views

Author

Keywords

Comments

According to rook theory, John Riordan considered a(1) to be -1. - Vladimir Shevelev, Apr 02 2010
This is also the value that the formulas of Touchard and of Wyman and Moser give and is compatible with many recurrences. - William P. Orrick, Aug 31 2020
Or, for n >= 3, the number of 3 X n Latin rectangles the second row of which is full cycle with a fixed order of its elements, e.g., the cycle (x_2,x_3,...,x_n,x_1) with x_1 < x_2 < ... < x_n. - Vladimir Shevelev, Mar 22 2010
Muir (p. 112) gives essentially this recurrence (although without specifying any initial conditions). Compare A186638. - N. J. A. Sloane, Feb 24 2011
Sequence discovered by Touchard in 1934. - L. Edson Jeffery, Nov 13 2013
Although these are also known as Touchard numbers, the problem was formulated by Lucas in 1891, who gave the recurrence formula shown below. See Cerasoli et al., 1988. - Stanislav Sykora, Mar 14 2014
An equivalent problem was formulated by Tait; solutions to Tait's problem were given by Muir (1878) and Cayley (1878). - William P. Orrick, Aug 31 2020
From Vladimir Shevelev, Jun 25 2015: (Start)
According to the ménage problem, 2*n!*a(n) is the number of ways of seating n married couples at 2*n chairs around a circular table, men and women in alternate positions, so that no husband is next to his wife.
It is known [Riordan, ch. 7] that a(n) is the number of arrangements of n non-attacking rooks on the positions of the 1's in an n X n (0,1)-matrix A_n with 0's in positions (i,i), i = 1,...,n, (i,i+1), i = 1,...,n-1, and (n,1). This statement could be written as a(n) = per(A_n). For example, A_5 has the form
001*11
1*0011
11001* (1)
11*100
0111*0,
where 5 non-attacking rooks are denoted by {1*}.
We can indicate a one-to-one correspondence between arrangements of n non-attacking rooks on the 1's of a matrix A_n and arrangements of n married couples around a circular table by the rules of the ménage problem, after the ladies w_1, w_2, ..., w_n have taken the chairs numbered
2*n, 2, 4, ..., 2*n-2 (2)
respectively. Suppose we consider an arrangement of rooks: (1,j_1), (2,j_2), ..., (n,j_n). Then the men m_1, m_2, ..., m_n took chairs with numbers
2*j_i - 3 (mod 2*n), (3)
where the residues are chosen from the interval[1,2*n]. Indeed {j_i} is a permutation of 1,...,n. So {2*j_i-3}(mod 2*n) is a permutation of odd positive integers <= 2*n-1. Besides, the distance between m_i and w_i cannot be 1. Indeed, the equality |2*(j_i-i)-1| = 1 (mod 2*n) is possible if and only if either j_i=i or j_i=i+1 (mod n) that correspond to positions of 0's in matrix A_n.
For example, in the case of positions of {1*} in(1) we have j_1=3, j_2=1, j_3=5, j_4=2, j_5=4. So, by(2) and (3) the chairs 1,2,...,10 are taken by m_4, w_2, m_1, w_3, m_5, w_4, m_3, w_5, m_2, w_1, respectively. (End)
The first 20 terms of this sequence were calculated in 1891 by E. Lucas (see [Lucas, p. 495]). - Peter J. C. Moses, Jun 26 2015
From Ira M. Gessel, Nov 27 2018: (Start)
If we invert the formula
Sum_{ n>=0 } u_n z^n = ((1-z)/(1+z)) F(z/(1+z)^2)
that Don Knuth mentions (see link) (i.e., set x=z/(1+z)^2 and solve for z in terms of x), we get a formula for F(z) = Sum_{n >= 0} n! z^n as a sum with all positive coefficients of (almost) powers of the Catalan number generating function.
The exact formula is (5) of the Yiting Li article.
This article also gives a combinatorial proof of this formula (though it is not as simple as one might want). (End)

Examples

			a(2) = 0; nothing works. a(3) = 1; (201) works. a(4) = 2; (2301), (3012) work. a(5) = 13; (20413), (23401), (24013), (24103), (30412), (30421), (34012), (34021), (34102), (40123), (43012), (43021), (43102) work.
		

References

  • W. W. R. Ball and H. S. M. Coxeter, Mathematical Recreations and Essays, 13th Ed. Dover, p. 50.
  • M. Cerasoli, F. Eugeni and M. Protasi, Elementi di Matematica Discreta, Nicola Zanichelli Editore, Bologna 1988, Chapter 3, p. 78.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 185, mu(n).
  • Kaplansky, Irving and Riordan, John, The probleme des menages, Scripta Math. 12, (1946). 113-124. See u_n.
  • E. Lucas, Théorie des nombres, Paris, 1891, pp. 491-495.
  • P. A. MacMahon, Combinatory Analysis. Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 1, p 256.
  • T. Muir, A Treatise on the Theory of Determinants. Dover, NY, 1960, Sect. 132, p. 112. - N. J. A. Sloane, Feb 24 2011
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.
  • V. S. Shevelev, Reduced Latin rectangles and square matrices with equal row and column sums, Diskr. Mat. (J. of the Akademy of Sciences of Russia) 4(1992), 91-110. - Vladimir Shevelev, Mar 22 2010
  • 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. M. Taylor, A problem on arrangements, Mess. Math., 32 (1902), 60ff.
  • J. Touchard, Permutations discordant with two given permutations, Scripta Math., 19 (1953), 108-119.
  • J. H. van Lint, Combinatorial Theory Seminar, Eindhoven University of Technology, Springer Lecture Notes in Mathematics, Vol. 382, 1974. See page 10.

Crossrefs

Diagonal of A058087. Also a diagonal of A008305.
A000179, A102761, and A335700 are all essentially the same sequence but with different conventions for the initial terms a(0) and a(1). - N. J. A. Sloane, Aug 06 2020

Programs

  • Haskell
    import Data.List (zipWith5)
    a000179 n = a000179_list !! n
    a000179_list = 1 : -1 : 0 : 1 : zipWith5
       (\v w x y z -> (x * y + (v + 2) * z - w) `div` v) [2..] (cycle [4,-4])
       (drop 4 a067998_list) (drop 3 a000179_list) (drop 2 a000179_list)
    -- Reinhard Zumkeller, Aug 26 2013
    
  • Maple
    A000179:= n ->add ((-1)^k*(2*n)*binomial(2*n-k,k)*(n-k)!/(2*n-k), k=0..n); # for n >= 1
    U:= proc(n) local k; add( (2*n/(2*n-k))*binomial(2*n-k,k)*(n-k)!*(x-1)^k, k=0..n); end; W := proc(r,s) coeff( U(r),x,s ); end; A000179 := n->W(n,0); # valid for n >= 1
  • Mathematica
    a[n_] := 2*n*Sum[(-1)^k*Binomial[2*n - k, k]*(n - k)!/(2*n - k), {k, 0, n}]; a[0] = 1; Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Dec 05 2012, from 2nd formula *)
  • PARI
    \\ 3 programs adapted to a(1) = -1 by Hugo Pfoertner, Aug 31 2020
    
  • PARI
    {a(n) = my(A); if( n, A = vector(n,i,i-2); for(k=4, n, A[k] = (k * (k - 2) * A[k-1] + k * A[k-2] - 4 * (-1)^k) / (k-2)); A[n], 1)};/* Michael Somos, Jan 22 2008 */
    
  • PARI
    a(n)=if(n>1, round(2*n*exp(-2)*besselk(n, 2)), 1-2*n) \\ Charles R Greathouse IV, Nov 03 2014
    
  • PARI
    {a(n) = my(A); if( n, A = vector(n,i,i-2); for(k=5, n, A[k] = k * A[k-1] + 2 * A[k-2] + (4-k) * A[k-3] - A[k-4]); A[n], 1)} /* Michael Somos, May 02 2018 */
    
  • Python
    from math import comb, factorial
    def A000179(n): return 1 if n == 0 else sum((-2*n if k & 1 else 2*n)*comb(m:=2*n-k,k)*factorial(n-k)//m for k in range(n+1)) # Chai Wah Wu, May 27 2022

Formula

a(n) = ((n^2-2*n)*a(n-1) + n*a(n-2) - 4*(-1)^n)/(n-2) for n >= 3.
a(n) = A059375(n)/(2*n!) for n >= 2.
a(n) = Sum_{k=0..n} (-1)^k*(2*n)*binomial(2*n-k, k)*(n-k)!/(2*n-k) for n >= 1. - Touchard (1934)
G.f.: ((1-x)/(1+x))*Sum_{n>=0} n!*(x/(1+x)^2)^n. - Vladeta Jovovic, Jun 26 2007
a(2^k+2) == 0 (mod 2^k); for k >= 2, a(2^k) == 2(mod 2^k). - Vladimir Shevelev, Jan 14 2011
a(n) = round( 2*n*exp(-2)*BesselK(n,2) ) for n > 1. - Mark van Hoeij, Oct 25 2011
a(n) ~ (n/e)^n * sqrt(2*Pi*n)/e^2. - Charles R Greathouse IV, Jan 21 2016
0 = a(n)*(-a(n+2) +a(n+4)) +a(n+1)*(+a(n+1) +a(n+2) -3*a(n+3) -5*a(n+4) +a(n+5)) +a(n+2)*(+2*a(n+2) +3*a(n+3) -3*a(n+4)) +a(n+3)*(+2*a(n+3) +a(n+4) -a(n+5)) +a(n+4)*(+a(n+4)), for all n>1. If a(-2..1) = (0, -1, 2, -1) then also true for those values of n. - Michael Somos, Apr 29 2018
D-finite with recurrence: 0 = a(n) +n*a(n+1) -2*a(n+2) +(-n-4)*a(n+3) +a(n+4), for all n in Z where a(n) = a(-n) for all n in Z and a(0) = 2, a(1) = -1. - Michael Somos, May 02 2018
a(n) = Sum_{k=0..n} A213234(n,k) * A000023(n-2*k) = Sum_{k=0..n} (-1)^k * n/(n-k) * binomial(n-k, k) * (n-2*k)! Sum_{j=0..n-2*k} (-2)^j/j! for n >= 1. [Wyman and Moser (1958)]. - William P. Orrick, Jun 25 2020
a(k+4*p) - 2*a(k+2*p) + a(k) is divisible by p, for any k > 0 and any prime p. - Mark van Hoeij, Jan 11 2022

Extensions

More terms from James Sellers, May 02 2000
Additional comments from David W. Wilson, Feb 18 2003
a(1) changed to -1 at the suggestion of Don Knuth. - N. J. A. Sloane, Nov 26 2018

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

Original entry on oeis.org

1, 3, 10, 38, 168, 872, 5296, 37200, 297856, 2681216, 26813184, 294947072, 3539368960, 46011804672, 644165281792, 9662479259648, 154599668219904, 2628194359869440, 47307498477912064, 898842471080853504, 17976849421618118656, 377513837853982588928
Offset: 0

Views

Author

Keywords

Comments

Incomplete Gamma Function at 2, more precisely: a(n) = exp(2)*Gamma(1+n,2).
Let P(A) be the power set of an n-element set A. Then a(n) = the total number of ways to add 0 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
a(n) is the number of ways to split the set {1,2,...,n} into two disjoint subsets S,T with S union T = {1,2,...,n} and linearly order S and then choose a subset of T. - Geoffrey Critzer, Mar 10 2009

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, Tenth Printing, 1972, p. 262.
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Example 5.1.2.

Crossrefs

Programs

  • Magma
    m:=45; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!(Exp(2*x)/(1-x))); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Oct 16 2018
  • Maple
    G(x):=exp(2*x)/(1-x): f[0]:=G(x): for n from 1 to 19 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..19); # Zerinvary Lajos, Apr 03 2009
    seq(simplify(exp(1)^2*GAMMA(n+1, 2)), n=0..19); # Peter Luschny, Apr 28 2016
    seq(simplify(KummerU(-n, -n, 2)), n=0..21); # Peter Luschny, May 10 2022
  • Mathematica
    With[{r = Round[n! E^2 - 2^(n + 1)/(n + 1)]}, r - Mod[r, 2^(n - Floor[2/n + Log2[n]])]] (* for n>=4; Stan Wagon, Apr 28 2016 *)
    a[n_] := n! Sum[2^i/i!, {i, 0, n}]
    Table[a[n], {n, 0, 21}] (* Gerry Martens , May 06 2016 *)
    With[{nn=30},CoefficientList[Series[Exp[2x]/(1-x),{x,0,nn}],x] Range[ 0,nn]!] (* Harvey P. Dale, May 27 2019 *)
  • PARI
    x='x+O('x^44); Vec(serlaplace(exp(2*x)/(1-x))) \\ Joerg Arndt, Apr 29 2016
    

Formula

a(n) = row sums of A090802. - Ross La Haye, Aug 18 2006
a(n) = n*a(n-1) + 2^n = (n+2)*a(n-1) - (2*n-2)*a(n-2) = n!*Sum_{j=0..n} floor(2^j/j!). - Henry Bottomley, Jul 12 2001
a(n) is the permanent of the n X n matrix with 3's on the diagonal and 1's elsewhere. a(n) = Sum_{k=0..n} A008290(n, k)*3^k. - Philippe Deléham, Dec 12 2003
Binomial transform of A000522. - Ross La Haye, Sep 15 2004
a(n) = Sum_{k=0..n} k!*binomial(n, k)*2^(n-k). - Paul Barry, Apr 22 2005
a(n) = A066534(n) + 2^n. - Ross La Haye, Nov 16 2005
G.f.: hypergeom([1,k],[],x/(1-2*x))/(1-2*x) with k=1,2,3 is the generating function for A010842, A081923, and A082031. - Mark van Hoeij, Nov 08 2011
E.g.f.: 1/E(0), where E(k) = 1 - x/(1-2/(2+(k+1)/E(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
G.f.: 1/Q(0), where Q(k)= 1 - 2*x - x*(k+1)/(1-x*(k+1)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 18 2013
a(n) ~ n! * exp(2). - Vaclav Kotesovec, Jun 01 2013
From Peter Bala, Sep 25 2013: (Start)
a(n) = n!*e^2 - Sum_{k >= 0} 2^(n + k + 1)/((n + 1)*...*(n + k + 1)).
= n!*e^2 - e^2*( Integral_{t = 0..2} t^n*exp(-t) dt )
= e^2*( Integral_{t >= 2} t^n*exp(-t) dt )
= e^2*( Integral_{t >= 0} t^n*exp(-t)*Heaviside(t-2) dt ),
an integral representation of a(n) as the n-th moment of a nonnegative function on the positive half-axis.
Bottomley's second-order recurrence above a(n) = (n + 2)*a(n-1) - 2*(n - 1)*a(n-2) has n! as a second solution. This yields the finite continued fraction expansion a(n)/n! = 1/(1 - 2/(3 - 2/(4 - 4/(5 - ... - 2*(n - 1)/(n + 2))))) valid for n >= 2. Letting n tend to infinity gives the infinite continued fraction expansion e^2 = 1/(1 - 2/(3 - 2/(4 - 4/(5 - ... - 2*(n - 1)/(n + 2 - ...))))). (End)
a(n) = 2^(n+1)*U(1, n+2, 2), where U is the Bessel U function. - Peter Luschny, Nov 26 2014
For n >= 4, a(n) = r - (r mod 2^(n - floor((2/n) + log_2(n)))) where r = n! * e^2 - 2^(n+1)/(n+1). - Stan Wagon, Apr 28 2016
G.f.: A(x) = 1/(1 - 2*x - x/(1 - x/(1 - 2*x - 2*x/(1 - 2*x/(1 - 2*x - 3*x/(1 - 3*x/(1 - 2*x - 4*x/(1 - 4*x/(1 - 2*x - ... ))))))))). - Peter Bala, May 26 2017
a(n) = Sum_{k=0..n} (-1)^(n-k)*A137346(n, k). - Mélika Tebni, May 10 2022 [This is equivalent to a(n) = KummerU(-n, -n, 2). - Peter Luschny, May 10 2022]
a(n) = F(n), where the function F(x) := 2^(x+1) * Integral_{t >= 0} e^(-2*t)*(1 + t)^x dt smoothly interpolates this sequence to all real values of x. - Peter Bala, Sep 05 2023

A055209 a(n) = Product_{i=0..n} i!^2.

Original entry on oeis.org

1, 1, 4, 144, 82944, 1194393600, 619173642240000, 15728001190723584000000, 25569049282962188245401600000000, 3366980847587422591723894776791040000000000, 44337041641882947649156022595410930014617600000000000000
Offset: 0

Views

Author

N. J. A. Sloane, Jul 18 2000

Keywords

Comments

a(n) is the discriminant of the polynomial x(x+1)(x+2)...(x+n). - Yuval Dekel (dekelyuval(AT)hotmail.com), Nov 13 2003
This is the Hankel transform (see A001906 for definition) of the sequence: 1, 0, 1, 0, 5, 0, 61, 0, 1385, 0, 50521, ... (see A000364: Euler numbers). - Philippe Deléham, Apr 06 2005
Also, for n>0, the quotient of (-1)^(n-1)S(u)^(n^2)/S(un) and the determinant of the (n-1) X (n-1) square matrix [P'(u), P''(u), ..., P^(n-1)(u); P''(u), P'''(u), ..., P^(n)(u); P'''(u), P^(4)(u), ..., P^(n+1)(u); ...; P^(n-1)(u), P^(n)(u), ..., P^(2n-3)(u)] where S and P are the Weierstrass Sigma and The Weierstrass P-function, respectively and f^(n) is the n-th derivative of f. See the King and Schwarz & Weierstrass references. - Balarka Sen, Jul 31 2013
a(n) is the number of idempotent monotonic labeled magmas. That is, prod(i,j) >= max(i,j) and prod(i,i) = i. - Chad Brewbaker, Nov 03 2013
Ramanujan's infinite nested radical sqrt(1+2*sqrt(1+3*sqrt(1+...))) = 3 can be written sqrt(1+sqrt(4+sqrt(144+...))) = sqrt(a(1)+sqrt(a(2)+sqrt(a(3)+...))). Vijayaraghavan used that to prove convergence of Ramanujan's formula. - Petros Hadjicostas and Jonathan Sondow, Mar 22 2014
a(n) is the determinant of the (n+1)-th order Hankel matrix whose (i,j)-entry is equal to A000142(i+j), i,j = 0,1,...,n. - Michael Shmoish, Sep 02 2020

References

  • R. Bruce King, Beyond The Quartic Equation, Birkhauser Boston, Berlin, 1996, p. 72.
  • Srinivasa Ramanujan, J. Indian Math. Soc., III (1911), 90 and IV (1912), 226.
  • T. Vijayaraghavan, in Collected Papers of Srinivasa Ramanujan, G.H. Hardy, P.V. Seshu Aiyar and B.M. Wilson, eds., Cambridge Univ. Press, 1927, p. 348; reprinted by Chelsea, 1962.

Crossrefs

Cf. A055209 is the Hankel transform (see A001906 for definition) of A000023, A000142, A000166, A000522, A003701, A010842, A010843, A051295, A052186, A053486, A053487.

Programs

  • Magma
    [1] cat [(&*[(Factorial(k))^2: k in [1..n]]): n in [1..10]]; // G. C. Greubel, Oct 14 2018
  • Maple
    seq(mul(mul(j^2,j=1..k), k=0..n), n=0..10); # Zerinvary Lajos, Sep 21 2007
  • Mathematica
    Table[Product[(i!)^2,{i,n}],{n,0,11}] (* Harvey P. Dale, Jul 06 2011 *)
    Table[BarnesG[n + 2]^2, {n, 0, 11}] (* Jan Mangaldan, May 07 2014 *)
  • PARI
    a(n)=prod(i=1,n,i!)^2 \\ Charles R Greathouse IV, Jan 12 2012
    
  • Sage
    def A055209(n) :
       return prod(factorial(i)^(2) for i in (0..n))
    [A055209(n) for n in (0..11)] # Jani Melik, Jun 06 2015
    

Formula

a(n) = A000178(n)^2. - Philippe Deléham, Mar 06 2004
a(n) = Product_{i=0..n} i^(2*n - 2*i + 2). - Charles R Greathouse IV, Jan 12 2012
Asymptotic: a(n) ~ exp(2*zeta'(-1)-3/2*(1+n^2)-3*n)*(2*Pi)^(n+1)*(n+1)^ (n^2+2*n+5/6). - Peter Luschny, Jun 23 2012
lim_{n->infinity} a(n)^(2^(-(n+1))) = 1. - Vaclav Kotesovec, Jun 06 2015
Sum_{n>=0} 1/a(n) = A258619. - Amiram Eldar, Nov 17 2020

A087981 E.g.f.: exp(-2*x) / (1-x)^2.

Original entry on oeis.org

1, 0, 2, 4, 24, 128, 880, 6816, 60032, 589312, 6384384, 75630080, 972387328, 13483769856, 200571078656, 3185540657152, 53800242216960, 962741176500224, 18195808235880448, 362183230599856128, 7572922094360723456, 165945771111208714240, 3802923921298533384192, 90965940197460917878784, 2267151124921333646884864
Offset: 0

Views

Author

Gordon F. Royle, Oct 28 2003

Keywords

Comments

Permanent of an (n+1) X (n+1) (+1, -1)-matrix with exactly n -1's on the diagonal and 1's everywhere else.
It is conjectured by Kräuter and Seifter that for n >= 5 a(n-1) is the maximal possible value for the permanent of a nonsingular n X n (+1, -1)-matrix. I do not know for which values of n this has been confirmed - compare A087982. - N. J. A. Sloane
The Kräuter conjecture on permanents is true (see Budrevich and Guterman). - Sergei Shteiner, Jan 17 2020
The maximal possible value for the permanent of a singular n X n (+1, -1)-matrix is obviously n!.
Degree of the "hyperdeterminant" of a multilinear polynomial on (\P^1(\C))^n, or equivalently of an element of (\C^2)^{⊗ n}: see Gelfand, Kapranov and Zelevinsky. - Eric Rains, Mar 15 2004
(-1)^n * a(n) = Polynomials in A010027 evaluated at -1. - Ralf Stephan, Dec 15 2004
a(n) is the number of n X n (-1, 0, 1)-matrices containing in every row and every column exactly one -1 and one 1 such that the main diagonal does not contain 0's. - Vladimir Shevelev, Apr 01 2010
a(n) is the number of colored permutations with no fixed points of n elements where each cycle is one of two colors. - Michael Somos, Jan 19 2011
Binomial transform is A000255. Hankel transform is A059332. - Paul Barry, Apr 11 2011
Exponential self-convolution of subfactorials (A000166). - Vladimir Reshetnikov, Oct 07 2016

Examples

			G.f. = 1 + 2*x^2 + 4*x^3 + 24*x^4 + 128*x^5 + 880*x^6 + 6816*x^7 + ...
Since a(1) = 0, then, for n = 2, we have a(2) = -(-2)^3/4 = 2; further, for n = 3, we find a(3) = (3*6/5)*2 - (-2)^4/5 = 36/5 - 16/5 = 4. - _Vladimir Shevelev_, Apr 01 2010
a(4) = 24 because there are 6 derangements with one 4-cycle with 2^1 ways to color each derangement and 3 derangements with two 2-cycles with 2^2 ways to color each derangement. - _Michael Somos_, Jan 19 2011
		

References

  • I. M. Gelfand, M. M. Kapranov, and A. V. Zelevinsky, Discriminants, Resultants and Multidimensional Determinants, Birkhauser, 1994; see Corollary 2.10 in Chapter 14 (p. 457).

Crossrefs

Programs

  • Maple
    seq(simplify(KummerU(-n, -n-1, -2)), n = 0..24); # Peter Luschny, May 10 2022
  • Mathematica
    Range[0, 20]! CoefficientList[Series[Exp[-2 x]/(1 - x)^2, {x, 0, 20}], x]
    Table[(-2)^n HypergeometricPFQ[{2, -n}, {}, 1/2], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 07 2016 *)
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( exp( -2 * x + x * O(x^n) ) / ( 1 - x )^2, n ) )} /* Michael Somos, Jan 19 2011 */

Formula

Krauter and Seifter prove that the permanent of an n X n {-1, 1} matrix is divisible by 2^{n - [log_2(n)] - 1}.
Let c(n) be the permanent of the {-1, +1}-matrix of order n X n with n diagonal -1's only. Let a(n) be the permanent of the {-1, +1}-matrix of order (n+1) X (n+1) with n diagonal -1's only. Then by expanding along the first row (like determinant, but with no sign) we get c(n+1) = -c(n) + n a(n-1), a(n) = c(n) + n a(n-1), with c(2) = 2, a(2) = 2. {c(n)} has e.g.f. exp(-2x)/(1-x), see A000023. Also a(n) = c(n+1) + 2*c(n).
The following 4 formulas hold: a(n) = Sum_{k = 0..n} C(n, k)*D_k*D_{n-k}, where D_n = A000166(n); a(n) = n!*Sum_{j = 0..n} (n+1-j)*(-2)^j/j!; a(0) = 1, a(1) = 0 and, for n > 0, a(n+1) = n*(a(n) + 2*a(n-1)); a(0) = 1 and, for n > 0, a(n) = (n*(n+3)/(n+2))*a(n-1) - (-2)^(n+1)/(n+2). - Vladimir Shevelev, Apr 01 2010 [edited by Michael Somos, Jan 19 2011]
G.f.: 1/(1-2x^2/(1-2x-6x^2/(1-4x-12x^2/(1-6x-20x^2/(1-.../(1-2n*x-(n+1)(n+2)x^2/(1-... (continued fraction). - Paul Barry, Apr 11 2011
E.g.f.: 1/U(0) where U(k)= 1 - 2*x/( 1 + x/(2 - x - 4/( 2 + x*(k+1)/U(k+1)))) ; (continued fraction, 3rd kind, 4-step). - Sergei N. Gladkovskii, Oct 28 2012
G.f.: 1/Q(0), where Q(k) = 1 + 2*x - x*(k+2)/(1 - x*(k+1)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 22 2013
G.f.: 1/Q(0) where Q(k) = 1 - 2*k*x - x^2*(k + 1)*(k+2)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, May 10 2013
G.f.: S(x)/x - 1/x = G(0)/x - 1/x, where S(x) = sum(k >= 0, k!*(x/(1+2*x))^k ), G(k) = 1 + (2*k + 1)*x/( 1+2*x - 2*x*(1+2*x)*(k+1)/(2*x*(k+1) + (1+2*x)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 26 2013
a(n) = (-2)^n*hypergeom([2, -n], [], 1/2) = 4*(-2)^n*(1 - 2*hypergeom([1, -n-3], [], 1/2))/(n^2+3*n+2) = (4*(-2)^n + Gamma(n+4, -2)*exp(-2))/(n^2+3*n+2). - Vladimir Reshetnikov, Oct 07 2016
a(n) ~ sqrt(2*Pi) * n^(n+3/2) / exp(n+2). - Vaclav Kotesovec, Oct 08 2016
a(n) = KummerU(-n, -n - 1, -2). - Peter Luschny, May 10 2022

Extensions

More terms from Jaap Spies, Oct 28 2003
Further terms from Gordon F. Royle, Oct 29 2003
Definition via e.g.f. from Eric Rains, Mar 15 2004
Changed the offset and terms to correspond to e.g.f, Michael Somos, Jan 19 2011

A102761 Same as A000179, except that a(0) = 2.

Original entry on oeis.org

2, -1, 0, 1, 2, 13, 80, 579, 4738, 43387, 439792, 4890741, 59216642, 775596313, 10927434464, 164806435783, 2649391469058, 45226435601207, 817056406224416, 15574618910994665, 312400218671253762, 6577618644576902053, 145051250421230224304, 3343382818203784146955, 80399425364623070680706, 2013619745874493923699123
Offset: 0

Views

Author

N. J. A. Sloane, Apr 04 2010, following a suggestion from Vladimir Shevelev

Keywords

Comments

For any integer n>=0, 2 * Integral_{t=-2..2} T_n(t/2)*exp(-t)*dt = 4 * Integral_{z=-1..1} T_n(z)*exp(-2*z)*dz = a(n)*exp(2) - A300484(n)*exp(-2). - Max Alekseyev, Mar 08 2018

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.

Crossrefs

Row m=2 in A300481.
A000179, A102761, and A335700 are all essentially the same sequence but with different conventions for the initial terms a(0) and a(1). - N. J. A. Sloane, Aug 06 2020

Programs

  • PARI
    { A102761(n) = subst( serlaplace( 2*polchebyshev(n, 1, (x-2)/2)), x, 1); } \\ Max Alekseyev, Mar 06 2018

Formula

a(n) = Sum_{i=0..n} A127672(n,i) * A000023(i). - Max Alekseyev, Mar 06 2018
a(n) = A300481(2,n) = A300480(-2,n). - Max Alekseyev, Mar 06 2018
a(n) = A335391(0,n) (Touchard). - William P. Orrick, Aug 29 2020

Extensions

Changed a(0)=2 (making the sequence more consistent with existing formulae) by Max Alekseyev, Mar 06 2018

A217924 a(n) = n! * [x^n] exp(2*exp(x) - x - 2). Row sums of triangle A217537.

Original entry on oeis.org

1, 1, 3, 9, 35, 153, 755, 4105, 24323, 155513, 1064851, 7760745, 59895203, 487397849, 4166564147, 37298443977, 348667014723, 3395240969785, 34365336725715, 360837080222761, 3923531021460707, 44108832866004121, 511948390801374835, 6126363766802713481
Offset: 0

Views

Author

Peter Luschny, Oct 15 2012

Keywords

Comments

The inverse binomial transform of a(n) is A194689.
A087981(n) = Sum_{k=0..n} (-1)^k*s(n+1,k+1)*a(k);
|A000023(n)| = |Sum_{k=0..n} (-1)^(n-k)*s(n,k)*a(k)|
where s(n,k) are the unsigned Stirling numbers of first kind.
a(n) is the number of inequivalent set partitions of {1,2,...,n} where two blocks are considered equivalent when one can be obtained from the other by an alternating (even) permutation. - Geoffrey Critzer, Mar 17 2013

Examples

			a(3)=9 because we have: {1,2,3}; {1,3,2}; {1}{2,3}; {1}{3,2}; {2}{1,3}; {2}{3,1}; {3}{1,2}; {3}{2,1}; {1}{2}{3}. - _Geoffrey Critzer_, Mar 17 2013
		

Crossrefs

Similar recurrences: A124758, A243499, A284005, A329369, A341392, A372205.

Programs

  • Magma
    R:=PowerSeriesRing(Rationals(), 30);
    Coefficients(R!(Laplace( Exp(2*Exp(x) -x-2) ))); // G. C. Greubel, Jan 09 2025
  • Maple
    egf := exp(2*exp(x) - x - 2): ser := series(egf, x, 25):
    seq(n!*coeff(ser, x, n), n = 0..23);  # Peter Luschny, Apr 22 2024
  • Mathematica
    nn=23;Range[0,nn]!CoefficientList[Series[Exp[2 Exp[x]-x-2],{x,0,nn}],x]  (* Geoffrey Critzer, Mar 17 2013 *)
    nmax = 25; CoefficientList[Series[1/(1 - x + ContinuedFractionK[-2*k*x^2 , 1 - (k + 1)*x, {k, 1, nmax}]), {x, 0, nmax}], x] (* Vaclav Kotesovec, Sep 25 2017 *)
  • Maxima
    a(n):=sum(sum(binomial(n,k-j)*2^j*(-1)^(k-j)*stirling2(n-k+j,j),j,0,k),k,0,n); /* Vladimir Kruchinin, Feb 28 2015 */
    
  • Sage
    def A217924_list(n):
        T = A217537_triangle(n)
        return [add(T.row(n)) for n in range(n)]
    A217924_list(24)
    
  • SageMath
    def A217924_list(prec):
        P. = PowerSeriesRing(QQ, prec)
        return P( exp(2*exp(x)-x-2) ).egf_to_ogf().list()
    print(A217924_list(40)) # G. C. Greubel, Jan 09 2025
    

Formula

G.f.: 1/Q(0) where Q(k) = 1 + x*k - x/(1 - 2*x*(k+1)/Q(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Mar 06 2013
E.g.f.: exp(2*exp(x) - x - 2). - Geoffrey Critzer, Mar 17 2013
G.f.: 1/Q(0), where Q(k) = 1 - (k+1)*x - 2*(k+1)*x^2/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, May 03 2013
G.f.: T(0)/(1-x), where T(k) = 1 - 2*x^2*(k+1)/( 2*x^2*(k+1) - (1-x-x*k)*(1-2*x-x*k)/T(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Oct 19 2013
a(n) = Sum_{k=0..n} Sum_{j=0..k} binomial(n,k-j)*2^j*(-1)^(k-j)*Stirling2(n-k+j,j). - Vladimir Kruchinin, Feb 28 2015
a(n) = exp(-2) * Sum_{k>=0} 2^k * (k - 1)^n / k!. - Ilya Gutkovskiy, Jun 27 2020
Conjecture: a(n) = Sum_{k=0..2^n-1} A372205(k). - Mikhail Kurkov, Nov 21 2021 [Rewritten by Peter Luschny, Apr 22 2024]
a(n) ~ 2 * n^(n-1) * exp(n/LambertW(n/2) - n - 2) / (sqrt(1 + LambertW(n/2)) * LambertW(n/2)^(n-1)). - Vaclav Kotesovec, Jun 26 2022

Extensions

Name extended by a formula of Geoffrey Critzer by Peter Luschny, Apr 22 2024

A010843 Incomplete Gamma Function at -3.

Original entry on oeis.org

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

Views

Author

Keywords

References

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

Crossrefs

Programs

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

Formula

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

A009102 Expansion of e.g.f. cos(x)/(1+x).

Original entry on oeis.org

1, -1, 1, -3, 13, -65, 389, -2723, 21785, -196065, 1960649, -21567139, 258805669, -3364473697, 47102631757, -706539476355, 11304631621681, -192178737568577, 3459217276234385, -65725128248453315, 1314502564969066301
Offset: 0

Views

Author

Keywords

Comments

The absolute value of a(n) equals the real part of the permanent of the n X n matrix with (1+i)'s along the main diagonal, and 1's everywhere else. - John M. Campbell, Jul 10 2011

Crossrefs

Cf. A009551, A000142, A000166, A000522, A000023, A053486, A010844 (incomplete Gamma function values at other points).

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!(Cos(x)/(1+x))); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Jul 26 2018
  • Maple
    G(x):=cos(x)/(1+x): f[0]:=G(x): for n from 1 to 20 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..20); # Zerinvary Lajos, Apr 03 2009
    g:= gfun:-rectoproc({a(0) = 1, a(1) = -1, a(2) = 1, a(n+3) = -(n+3)*a(n+2)-a(n+1)-(n+1)*a(n)},a(n),remember):
    seq(g(n),n=0..30); # Robert Israel, Oct 27 2015
  • Mathematica
    Table[SeriesCoefficient[Cos[x]/(1+x), {x, 0, n}] n!, {n, 0, 20}]
    Round@Table[(-1)^n Re[Gamma[n+1, I] E^I], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 27 2015 *)
    With[{nn=20},CoefficientList[Series[Cos[x]/(1+x),{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Feb 18 2024 *)
  • PARI
    x='x+O('x^30); Vec(serlaplace(cos(x)/(1+x))) \\ G. C. Greubel, Jul 26 2018
    

Formula

a(n) = (-1)^n*round(n!*cos(1)). - Vladeta Jovovic, Aug 11 2002
a(n) = (-1)^n * n! * Sum_{k=0..floor(n/2)} (-1)^k/(2k)!. Unsigned sequence satisfies e.g.f. cos(x)/(1-x). - Ralf Stephan, Apr 16 2004
E.g.f.: cos(x)/(1+x) = U(0)/(1-x^2) where U(k) = 1 - x/(1 - x/(x + (2*k+1)*(2*k+2)/U(k+1))) ; (continued fraction, 3-step). - Sergei N. Gladkovskii, Oct 17 2012
From Vladimir Reshetnikov, Oct 27 2015: (Start)
a(n) = Re((-i)^n*hypergeom([1,-n], [], i)).
a(n) = (-1)^n*(cos(1)*(n+2)!+cos(Pi*n/2)*hypergeom([1], [n/2+2,(n+3)/2], -1/4)+sin(Pi*n/2)*(n+2)*hypergeom([1], [n/2+1,(n+3)/2], -1/4))/(n^2+3*n+2).
a(n) = (-1)^n*Re(Gamma(n+1, i)*exp(i)) = (-1)^n*(Gamma(n+1, i)*exp(i)+Gamma(n+1, -i)*exp(-i))/2, where Gamma(a, x) is the upper incomplete Gamma function, i=sqrt(-1).
Gamma(n+1, i) = exp(-i)*((-1)^n*a(n) + A009551(n)*i).
a(0) = 1, a(1) = -1, a(2) = 1, a(n+3) = -(n+3)*a(n+2)-a(n+1)-(n+1)*a(n). (End)

Extensions

Extended with signs by Olivier Gérard, Mar 15 1997

A009551 Expansion of sin(x)/(1-x).

Original entry on oeis.org

0, 1, 2, 5, 20, 101, 606, 4241, 33928, 305353, 3053530, 33588829, 403065948, 5239857325, 73358002550, 1100370038249, 17605920611984, 299300650403729, 5387411707267122, 102360822438075317, 2047216448761506340
Offset: 0

Views

Author

Keywords

Comments

a(n) equals the imaginary part of the permanent of the n X n matrix with (1+i)'s along the main diagonal, and 1's everywhere else. - John M. Campbell, Jul 10 2011

Crossrefs

Cf. A009102, A000142, A000166, A000522, A000023, A053486, A010844 (incomplete Gamma function values at other points).

Programs

  • Magma
    I:=[1,2,5]; [0] cat [n le 3 select I[n] else n*Self(n-1)-Self(n-2)+(n-2)*Self(n-3): n in [1..30]]; // G. C. Greubel, Jan 19 2018
  • Maple
    restart: G(x):=sin(x)/(1-x): f[0]:=G(x): for n from 1 to 21 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..20); # Zerinvary Lajos, Apr 03 2009
  • Mathematica
    Table[n!*SeriesCoefficient[Sin[x]/(1-x),{x,0,n}],{n,0,20}] (* corrected by Vaclav Kotesovec, Oct 07 2012 *)
    With[{nn=30},CoefficientList[Series[Sin[x]/(1-x),{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Apr 17 2013 *)
    Round@Table[Im[Gamma[n+1, I] E^I], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 27 2015 *)
  • PARI
    a(n) = round(n!*sin(1))
    

Formula

a(n) = round(n!*sin(1)), n>=1. - Vladeta Jovovic, Aug 11 2002
a(n) = n! * Sum_{k=0..floor(n/2)} (-1)^k/(2k-1)!, n>0. - Ralf Stephan, Apr 16 2004
a(n) = n*a(n-1) - a(n-2) +(n-2)*a(n-3). - Vaclav Kotesovec, Oct 07 2012
From Vladimir Reshetnikov, Oct 27 2015: (Start)
a(n) = Im(i^n*hypergeom([1,-n], [], i)).
a(n) = n!*sin(1)-cos(Pi*n/2)*hypergeom([1], [n/2+1,(n+3)/2], -1/4)/(n+1) + sin(Pi*n/2)*hypergeom([1], [n/2+2,(n+3)/2], -1/4)/(n^2+3*n+2).
a(n) = Im(Gamma(n+1, i)*exp(i)) = (Gamma(n+1, i)*exp(i)-Gamma(n+1, -i)*exp(-i))/(2*i), where Gamma(a, x) is the upper incomplete Gamma function, i=sqrt(-1).
Gamma(n+1, i) = exp(-i)*((-1)^n*A009102(n) + a(n)*i). (End)

Extensions

More terms from Benoit Cloitre, Aug 13 2002
Showing 1-10 of 31 results. Next