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

A001040 a(n+1) = n*a(n) + a(n-1) with a(0)=0, a(1)=1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

If the initial 0 and 1 are omitted, CONTINUANT transform of 1, 2, 3, 4, 5, ...
a(n+1) is the numerator of the continued fraction given by C(n) = [n, n-1,...,3,2,1], e.g., [1] = 1, [2,1]=3, [3,2,1] = 10/3, [4,3,2,1] = 43/10 etc. Cf. A001053. - Amarnath Murthy, May 02 2001
Along those lines, a(n) is the denominator of the continued fraction [n,n-1,...3,2,1] and is the numerator of the continued fraction [1,2,3,...,n-1]. - Greg Dresden, Feb 20 2020
Starting (1, 3, 10, 43, ...) = eigensequence of triangle A127701. - Gary W. Adamson, Dec 29 2008
For n >=2, a(n) equals the permanent of the (n-1) X (n-1) tridiagonal matrix with 1's along the superdiagonal and the subdiagonal, and consecutive integers from 1 to n along the main diagonal (see Mathematica program below). - John M. Campbell, Jul 08 2011
Generally, solution of the recurrence a(n+1) = n*a(n) + a(n-1) is a(n) = BesselI(n,-2)*(2*a(0)*BesselK(1,2)-2*a(1)*BesselK(0,2)) + (2*a(0)*BesselI(1,2)+2*a(1)*BesselI(0,2))*BesselK(n,2), and asymptotic is a(n) ~ (a(0)*BesselI(1,2)+a(1)*BesselI(0,2)) * (n-1)!. - Vaclav Kotesovec, Jan 05 2013
For n > 0: a(n) = A058294(n,n) = A102473(n,n) = A102472(n,1). - Reinhard Zumkeller, Sep 14 2014
Conjecture: 2*n!*a(n) is the number of open tours by a rook on an (n X 2) chessboard which ends at the opposite line of length n. - Mikhail Kurkov, Nov 19 2019

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).

Crossrefs

A column of A058294. Cf. A001053.
Cf. A127701. - Gary W. Adamson, Dec 29 2008
Similar recurrences: A001053, A058279, A058307. - Wolfdieter Lang, May 19 2010

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

A001053 a(n+1) = n*a(n) + a(n-1) with a(0)=1, a(1)=0.

Original entry on oeis.org

1, 0, 1, 2, 7, 30, 157, 972, 6961, 56660, 516901, 5225670, 57999271, 701216922, 9173819257, 129134686520, 1946194117057, 31268240559432, 533506283627401, 9634381345852650, 183586751854827751, 3681369418442407670, 77492344539145388821, 1708512949279640961732
Offset: 0

Views

Author

Keywords

Comments

Denominator of continued fraction given by C(n) = [ 1; 2,3,4,...n ]. Cf. A001040. - Amarnath Murthy, May 02 2001
If initial 1 is omitted, CONTINUANT transform of 0, 1, 2, 3, 4, 5, ...
Number of deco polyominoes of height n having no 1-cell columns. 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(2)=1 because the vertical and horizontal dominoes are the deco polyominoes of height 2, of which only the vertical domino does not have 1-cell columns. a(n)=A121554(n,0). - Emeric Deutsch, Aug 16 2006
For positive n, a(n) equals the permanent of the n X n tridiagonal matrix with 1's along the superdiagonal and the subdiagonal, and consecutive integers from 0 to n-1 along the main diagonal (see Mathematica code below). - John M. Campbell, Jul 08 2011
Conjecture: 2*n!*a(n) is the number of open tours by a rook on an (n X 2) chessboard which starts and ends at the same line of length n. - Mikhail Kurkov, Nov 19 2019

Examples

			G.f. = 1 + x^2 + 2*x^3 + 7*x^4 + 30*x^5 + 157*x^6 + 972*x^7 + 6961*x^8 + ...
a(5) = 4*a(4) + a(3) = 4*7+2 = 30.
See A058279 and A058307 for similar recurrences and e.g.f.s. - _Wolfdieter Lang_, May 19 2010
		

References

  • Archimedeans Problems Drive, Eureka, 20 (1957), 15.
  • M. E. Larsen, Summa Summarum, A. K. Peters, Wellesley, MA, 2007; see p. 35. [From N. J. A. Sloane, Jan 29 2009]
  • 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

A column of A058294.
The square roots of the terms of A144656.
See also the constant in A060997.

Programs

  • GAP
    a:=[0,1];; for n in [3..25] do a[n]:=(n-1)*a[n-1]+a[n-2]; od; Concatenation([1], a); # G. C. Greubel, Sep 20 2019
  • Haskell
    a001053 n = a001053_list !! n
    a001053_list = 1 : 0 :
       zipWith (+) a001053_list (zipWith (*) [1..] $ tail a001053_list)
    -- Reinhard Zumkeller, Nov 02 2011
    
  • Magma
    I:=[0,1]; [1] cat [n le 2 select I[n] else (n-1)*Self(n-1) + Self(n-2): n in [1..25]]; // G. C. Greubel, Sep 20 2019
    
  • Maple
    a[0]:=1: a[1]:=0: for n from 2 to 23 do a[n]:=(n-1)*a[n-1]+a[n-2] od: seq(a[n],n=0..23); # Emeric Deutsch, Aug 16 2006
  • Mathematica
    a[0]=1; a[1] =0; a[n_]:= (n-1)*a[n-1] + a[n-2]; Table[a[n], {n, 0, 21}] (* Robert G. Wilson v, Feb 24 2005 *)
    a[0] = 1; a[1] = 0; a[n_] := Permanent[SparseArray[{{i_, i_} :> i-1, Band[{2, 1}] -> 1, Band[{1, 2}] -> 1}, {n, n}]]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 20}] (* John M. Campbell, Jul 08 2011, updated by Jean-François Alcover, Nov 14 2016 *)
    RecurrenceTable[{a[0]==1,a[1]==0,a[n]==(n-1)a[n-1]+a[n-2]},a,{n,30}] (* Harvey P. Dale, Jan 31 2013 *)
    a[ n_] := With[ {m = Abs@n}, If[ m < 2, Boole[m == 0],
    Gamma[m] HypergeometricPFQ[{3/2 - m/2, 1 - m/2}, {2, 2 - m, 1 - m}, 4]]]; (* Michael Somos, Nov 30 2018 *)
  • PARI
    {a(n) = contfracpnqn(vector(abs(n), i, i))[2, 2]}; /* Michael Somos, Sep 25 2005 */
    
  • Sage
    def A001053(n):
        if n < 3: return 1 if n != 1 else 0
        return gamma(n)*hypergeometric([3/2-n/2,1-n/2], [2,2-n,1-n], 4)
    [round(A001053(n).n(100)) for n in (0..23)] # Peter Luschny, Sep 11 2014
    

Formula

a(n) = a(-n). for all n in Z. - Michael Somos, Sep 25 2005
E.g.f.: -Pi*(BesselI(1,2)*BesselY(0, 2*I*sqrt(1-x)) + I*BesselY(1, 2*I)*BesselI(0, 2*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
a(n) = 2*K_1(2)*I_n(-2)+2*I_1(2)*K_n(2), where In(z) is the modified Bessel function of the first kind and Kn(x) is the modified Bessel function of the second kind. - Alexander R. Povolotsky, Jan 26 2011
Limit_{n->infinity} a(n)/(n-1)! = BesselI(1,2) = 1.590636854637329... (A096789). - Vaclav Kotesovec, Jan 05 2013, corrected Mar 02 2013
a(n+1) = Sum_{k = 0..floor((n-1)/2)} (n-2*k-1)!*binomial(n-k-1,k) * binomial(n-k,k+1). Cf. A058798. - Peter Bala, Aug 01 2013
a(n) = Gamma(n)*hypergeometric([3/2-n/2, 1-n/2], [2, 2-n, 1-n], 4) for n >= 3. - Peter Luschny, Sep 11 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, Feb 09 2017
Observed: a(n) = A096789*(n-1)!*(1 + 1/(n-1) + 1/(2*(n-1)^2) + O((n-1)^-3)). - A.H.M. Smeets, Aug 19 2018

Extensions

More terms from James Sellers, Sep 19 2000

A058308 a(n) = (n+2)*a(n-1) + a(n-2), with a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 4, 21, 130, 931, 7578, 69133, 698908, 7757121, 93784360, 1226953801, 17271137574, 260294017411, 4181975416150, 71353876091961, 1288551745071448, 24553837032449473, 492365292394060908, 10364224977307728541, 228505314793164088810
Offset: 0

Views

Author

N. J. A. Sloane, Dec 09 2000

Keywords

Crossrefs

A column of A058294.
Similar recurrences: A001040, A001053, A058279, A058307, A093858. - Wolfdieter Lang, May 19 2010
Cf. A058798.

Programs

  • Magma
    I:=[1,4]; [0] cat [n le 2 select I[n] else (n+2)*Self(n-1) +Self(n-2): n in [1..30]]; // G. C. Greubel, Nov 24 2018
    
  • Mathematica
    RecurrenceTable[{a[0]==0,a[1]==1,a[n]==a[n-2]+(n+2)a[n-1]},a[n], {n,20}] (* Harvey P. Dale, May 21 2011 *)
    FullSimplify[Table[(-4*BesselI[3+n,-2]*BesselK[4,2] + BesselI[3+n,-2]*BesselK[5,2] + 4*BesselI[4,2]*BesselK[3+n,2] + BesselI[5,2]*BesselK[3+n,2]) / (BesselI[5,2]*BesselK[4,2] + BesselI[4,2]*BesselK[5,2]),{n,0,20}]] (* Vaclav Kotesovec, Oct 05 2013 *)
  • PARI
    m=30; v=concat([1,4], vector(m-2)); for(n=3, m, v[n]=(n+2)*v[n-1] +v[n-2]); concat([0], v) \\ G. C. Greubel, Nov 24 2018
    
  • Sage
    def A058308(n):
        if n < 2: return n
        return factorial(n+2)*hypergeometric([1/2-n/2, 1-n/2], [4, -n-2, 1-n], 4)/6
    [round(A058308(n).n(100)) for n in (0..20)] # Peter Luschny, Sep 10 2014
    
  • Sage
    @cached_function
    def A058308(n):
        if n==0: return 0
        if n==1: return 1
        return (n+2)*A058308(n-1) + A058308(n-2)
    [A058308(n) for n in range(30)]  # G. C. Greubel, Nov 24 2018

Formula

E.g.f.: -Pi*(BesselY(4, 2*i)*BesselI(3, 2*sqrt(1-x)) - i*BesselI(4, 2)*BesselY(3, 2*i*sqrt(1-x)))/(1-x)^(3/2). Such e.g.f. computations were the result of an e-mail exchange with Gary Detlefs. After differentiation and setting 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
a(n) = Sum_{k = 0..floor((n-1)/2)} (n-2*k-1)!*binomial(n-k-1,k)* binomial(n-k+2,k+3). Cf. A058798. - Peter Bala, Aug 01 2013
a(n) = (-4*BesselI(3+n,-2)*BesselK(4,2) + BesselI(3+n,-2)*BesselK(5,2) + 4*BesselI(4,2)*BesselK(3+n,2) + BesselI(5,2)*BesselK(3+n,2)) / (BesselI(5,2)*BesselK(4,2) + BesselI(4,2)*BesselK(5,2)). - Vaclav Kotesovec, Oct 05 2013
a(n) ~ (4*BesselI(4,2) + BesselI(5,2))/(BesselI(5,2)*BesselK(4,2) + BesselI(4,2)*BesselK(5,2)) * sqrt(Pi/2) * n^(n+5/2)/exp(n). - Vaclav Kotesovec, Oct 05 2013
a(n) = (n+2)!*hypergeometric([1/2-n/2,1-n/2],[4,-n-2,1-n],4)/6 for n >= 2. - Peter Luschny, Sep 10 2014
a(n) = (n+1)! [x^(n+1)] (2/(1-x))*(K(3,2)*I(2,2*sqrt(1-x))+I(3,2)*K(2,2*sqrt(1-x))), K and I Bessel functions. - Peter Luschny, May 01 2017

A093858 a(0) = 1, a(1)= 2, a(n) = (a(n+1) - a(n-1))/n, or a(n+1) = n*a(n) + a(n-1).

Original entry on oeis.org

1, 2, 3, 8, 27, 116, 607, 3758, 26913, 219062, 1998471, 20203772, 224239963, 2711083328, 35468323227, 499267608506, 7524482450817, 120890986821578, 2062671258417643, 37248973638339152, 709793170386861531
Offset: 0

Views

Author

Amarnath Murthy, Apr 19 2004

Keywords

Crossrefs

Similar recurrences: A001040, A001053, A058279, A058307. - Wolfdieter Lang, May 19 2010

Programs

  • Mathematica
    a = 1; b = 2; Print[a]; Print[b]; Do[c = n*b + a; Print[c]; a = b; b = c, {n, 1, 30}] (* Ryan Propper, Sep 14 2005 *)
    nxt[{n_,a_,b_}]:={n+1,b,b*n+a}; NestList[nxt,{1,1,2},20][[;;,2]] (* Harvey P. Dale, Dec 23 2023 *)

Formula

a(n) = -2*(BesselI[n, -2]*(2 BesselK[0, 2] - BesselK[1, 2]) + (-2 BesselI[0, 2] + BesselI[1, -2])*BesselK[n, 2]). - Ryan Propper, Sep 14 2005
E.g.f.: -3*Pi*(BesselI(1, 2)*BesselY(0, 2*I*sqrt(1-x)) + I*BesselY(1, 2*I)*BesselI(0, 2*sqrt(1-x))). Such e.g.f. computations were the result of an e-mail exchange with Gary Detlefs. After differentiation and setting 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
Lim_{n->infinity} a(n)/(n-1)! = 2*BesselI(0,2) - BesselI(1,-2) = 6.1498074593094635982566633... - Vaclav Kotesovec, Jan 05 2013

Extensions

a(10)-a(20) from Ryan Propper, Sep 14 2005

A228340 Triangle read by rows: T(n,k) = (n-1)*T(n-1,k) + T(n-2,k), with T(n,n-1)=1, T(n,n-2)=n-2, for n >= 1, 0 <= k <= n-1.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 3, 4, 2, 1, 13, 17, 9, 3, 1, 68, 89, 47, 16, 4, 1, 421, 551, 291, 99, 25, 5, 1, 3015, 3946, 2084, 709, 179, 36, 6, 1, 24541, 32119, 16963, 5771, 1457, 293, 49, 7, 1, 223884, 293017, 154751, 52648, 13292, 2673, 447, 64, 8, 1
Offset: 1

Views

Author

N. J. A. Sloane, Aug 29 2013

Keywords

Examples

			Triangle begins:
1,
0,1,
1,1,1,
3,4,2,1,
13,17,9,3,1,
68,89,47,16,4,1,
421,551,291,99,25,5,1,
3015,3946,2084,709,179,36,6,1,
...
		

Crossrefs

Diagonals give A058307, A058279, A228341. Row sums give A001040.

Programs

  • Haskell
    a228340 n k = a228340_tabl !! (n-1) !! k
    a228340_row n = a228340_tabl !! (n-1)
    a228340_tabl = map (reverse . fst) $ iterate f ([1], [1,0]) where
       f (us, vs'@( : vs@(v : ))) = (vs', ws) where
         ws = 1 : (v + 1) : zipWith (+) us (map (* (v + 2)) vs)
    -- Reinhard Zumkeller, Aug 31 2013

A228341 Third diagonal (T(n,2)) of triangle in A228340.

Original entry on oeis.org

1, 2, 9, 47, 291, 2084, 16963, 154751, 1564473, 17363954, 209931921, 2746478927, 38660636899, 582656032412, 9361157155491, 159722327675759, 2884363055319153, 54962620378739666, 1102136770630112473, 23199834803611101599
Offset: 2

Views

Author

N. J. A. Sloane, Aug 29 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Table[FullSimplify[-2*BesselI[1+n,-2] * (BesselK[2,2] + BesselK[3,2]) + 2*(BesselI[2,2] - BesselI[3,2]) * BesselK[1+n,2]],{n,2,20}] (* Vaclav Kotesovec, Feb 14 2014 *)
  • PARI
    v = [1, 2]; for(n=4, 21, v = concat(v, n*v[n-2] + v[n-3])); v \\ Rick L. Shepherd, Jan 22 2014

Formula

a(2) = 1, a(3) = 2; thereafter, a(n) = n*a(n-1) + a(n-2).
a(n) ~ c * n!, where c = BesselI(2,2)-BesselI(3,2) = 0.47620848845888... - Vaclav Kotesovec, Feb 14 2014

Extensions

More terms from Rick L. Shepherd, Jan 22 2014
Showing 1-6 of 6 results.