A001040 a(n+1) = n*a(n) + a(n-1) with a(0)=0, a(1)=1.
0, 1, 1, 3, 10, 43, 225, 1393, 9976, 81201, 740785, 7489051, 83120346, 1004933203, 13147251985, 185066460993, 2789144166880, 44811373131073, 764582487395121, 13807296146243251, 263103209266016890, 5275871481466581051, 111056404320064218961, 2448516766522879398193
Offset: 0
Examples
G.f. = x + x^2 + 3*x^3 + 10*x^4 + 43*x^5 + 225*x^6 + 1393*x^7 + 9976*x^8 + ...
References
- Archimedeans Problems Drive, Eureka, 22 (1959), 15.
- 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).
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..450 (first 101 terms from T. D. Noe)
- C. Cannings, The Stationary Distributions of a Class of Markov Chains, Applied Mathematics, Vol. 4 No. 5, 2013, pp. 769-773. doi: 10.4236/am.2013.45105. See Table 1.
- T. Doslic and R. Sharafdini, Hosoya index of splices, bridges and necklaces, Research Gate, 2015.
- Tomislav Doslic and R. Sharafdini, Hosoya Index of Splices, Bridges, and Necklaces, in Distance, Symmetry, and Topology in Carbon Nanomaterials, 2016, pp 147-156. Part of the Carbon Materials: Chemistry and Physics book series (CMCP, volume 9), doi:10.1007/978-3-319-31584-3_10.
- R. K. Guy, Letters to N. J. A. Sloane, June-August 1968
- S. Janson, A divergent generating function that can be summed and analysed analytically, Discrete Mathematics and Theoretical Computer Science; 2010, Vol. 12, No. 2, 1-22.
- N. J. A. Sloane, Transforms
- Eric Weisstein's World of Mathematics, Continued Fraction Constants
- Eric Weisstein's World of Mathematics, Generalized Continued Fraction
Crossrefs
Programs
-
Haskell
a001040 n = a001040_list !! n a001040_list = 0 : 1 : zipWith (+) a001040_list (zipWith (*) [1..] $ tail a001040_list) -- Reinhard Zumkeller, Mar 05 2013
-
Magma
a:=[1,1]; [0] cat [n le 2 select a[n] else (n-1)*Self(n-1) + Self(n-2): n in [1..23]]; // Marius A. Burtea, Nov 19 2019
-
Maple
A001040 := proc(n) if n <= 1 then n; else (n-1)*procname(n-1)+procname(n-2) ; end if; end proc: # R. J. Mathar, Mar 13 2015
-
Mathematica
Table[Permanent[Array[KroneckerDelta[#1, #2]*(#1) + KroneckerDelta[#1, #2 - 1] + KroneckerDelta[#1, #2 + 1] &, {n - 1, n - 1}]], {n, 2, 30}] (* John M. Campbell, Jul 08 2011 *) Join[{0},RecurrenceTable[{a[0]==1,a[1]==1,a[n]==n a[n-1]+a[n-2]}, a[n], {n,30}]] (* Harvey P. Dale, Aug 14 2011 *) FullSimplify[Table[2(-BesselI[n,-2]BesselK[0,2]+BesselI[0,2]BesselK[n,2]),{n,0,20}]] (* Vaclav Kotesovec, Jan 05 2013 *)
-
PARI
{a(n) = contfracpnqn( vector(abs(n), i, i))[1, 2]}; /* Michael Somos, Sep 25 2005 */
-
Sage
def A001040(n): if n < 2: return n return factorial(n-1)*hypergeometric([1-n/2,-n/2+1/2], [1,1-n,1-n], 4) [round(A001040(n).n(100)) for n in (0..23)] # Peter Luschny, Sep 10 2014
Formula
Generalized Fibonacci sequence for (unsigned) Laguerre triangle A021009. a(n+1) = sum{k=0..floor(n/2), C(n-k, k)(n-k)!/k!}. - Paul Barry, May 10 2004
a(-n) = a(n) for all n in Z. - Michael Somos, Sep 25 2005
E.g.f.: -I*Pi*(BesselY(1, 2*I)*BesselI(0, 2*sqrt(1-x)) - I*BesselI(1, 2)*BesselY(0, 2*I*sqrt(1-x))). Such e.g.f. computations were the result of an e-mail exchange with Gary Detlefs. After differentiation and putting x=0 one has to use simplifications. See the Abramowitz-Stegun handbook, p. 360, 9.1.16 and p. 375, 9.63. - Wolfdieter Lang, May 19 2010
Limit_{n->infinity} a(n)/(n-1)! = BesselI(0,2) = 2.279585302336... (see A070910). - Vaclav Kotesovec, Jan 05 2013
a(n) = 2*(BesselI(0,2)*BesselK(n,2) - BesselI(n,-2)*BesselK(0,2)). - Vaclav Kotesovec, Jan 05 2013
a(n) = (n-1)!*hypergeometric([1-n/2,1/2-n/2],[1,1-n,1-n], 4) for n >= 2. - Peter Luschny, Sep 10 2014
0 = a(n)*(-a(n+2)) + a(n+1)*(+a(n+1) + a(n+2) - a(n+3)) + a(n+2)*(+a(n+2)) for all n in Z. - Michael Somos, Sep 13 2014
Observed: a(n) = A070910*(n-1)!*(1 + 1/(n-1) + 1/(2*(n-1)^2) + O((n-1)^-3)). - A.H.M. Smeets, Aug 19 2018
a(n) mod 2 = A166486(n). - Alois P. Heinz, Jul 03 2023
Extensions
Definition clarified by A.H.M. Smeets, Aug 19 2018
Comments