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

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

Original entry on oeis.org

0, 1, 2, 5, 18, 85, 492, 3359, 26380, 234061, 2314230, 25222469, 300355398, 3879397705, 54011212472, 806288789375, 12846609417528, 217586071308601, 3903702674137290, 73952764737299909, 1475151592071860890
Offset: 0

Views

Author

Christian G. Bower, Dec 02 2000

Keywords

Comments

Note that a(n) = (a(n-1) + a(n+1))/(n+1). - T. D. Noe, Oct 12 2012; corrected by Gary Detlefs, Oct 26 2018
a(n) = log_2(A073888(n)) = log_3(A073889(n)).
a(n) equals minus the determinant of M(n+2) where M(n) is the n X n symmetric tridiagonal matrix with entries 1 just above and below its diagonal and diagonal entries 0, 1, 2, .., n-1. Example: M(4)=matrix([[0, 1, 0, 0], [1, 1, 1, 0], [0, 1, 2, 1], [0, 0, 1, 3]]). - Roland Bacher, Jun 19 2001
a(n) = A221913(n,-1), n>=1, is the numerator sequence of the n-th approximation of the continued fraction -(0 + K_{k>=1} (-1/k)) = 1/(1-1/(2-1/(3-1/(4-... The corresponding denominator sequence is A058797(n). - Wolfdieter Lang, Mar 08 2013
The recurrence equation a(n+1) = (A*n + B)*a(n) + C*a(n-1) with the initial conditions a(0) = 0, a(1) = 1 has the solution a(n) = Sum_{k = 0..floor((n-1)/2)} C^k*binomial(n-k-1,k)*( Product_{j = 1..n-2k-1} (k+j)*A + B ). This is the case A = 1, B = 1, C = -1. - Peter Bala, Aug 01 2013

Examples

			Continued fraction approximation 1/(1-1/(2-1/(3-1/4))) = 18/7 = a(4)/A058797(4). - _Wolfdieter Lang_, Mar 08 2013
		

Crossrefs

Column 1 of A007754.
Cf. A073888, A073889, A221913 (alternating row sums).

Programs

  • GAP
    a:=[1,2];; for n in [3..25] do a[n]:=n*a[n-1]-a[n-2]; od; Concatenation([0], a); # Muniru A Asiru, Oct 26 2018
    
  • Magma
    [0] cat [n le 2 select n else n*Self(n-1)-Self(n-2): n in [1..30]]; // Vincenzo Librandi, Sep 22 2016
    
  • Mathematica
    t = {0, 1}; Do[AppendTo[t, n*t[[-1]] - t[[-2]]], {n, 2, 25}]; t (* T. D. Noe, Oct 12 2012 *)
    nxt[{n_,a_,b_}]:={n+1,b,b*(n+1)-a}; Transpose[NestList[nxt,{1,0,1},20]] [[2]] (* Harvey P. Dale, Nov 30 2015 *)
  • PARI
    m=30; v=concat([1,2], vector(m-2)); for(n=3, m, v[n] = n*v[n-1]-v[n-2]); concat(0, v) \\ G. C. Greubel, Nov 24 2018
  • Sage
    def A058798(n):
        if n < 3: return n
        return hypergeometric([1/2-n/2, 1-n/2],[2, 1-n, -n], -4)*factorial(n)
    [simplify(A058798(n)) for n in (0..20)] # Peter Luschny, Sep 10 2014
    

Formula

a(n) = Sum_{k = 0..floor((n-1)/2)} (-1)^k*binomial(n-k-1,k)*(n-k)!/(k+1)!. - Peter Bala, Aug 01 2013
a(n) = A058797(n+1) + A058799(n-1). - Henry Bottomley, Feb 28 2001
a(n) = Pi*(BesselY(1, 2)*BesselJ(n+1, 2) - BesselJ(1,2)* BesselY(n+1,2)). See the Abramowitz-Stegun reference given under A103921, p. 361 eq. 9.1.27 (first line with Y, J and z=2) and p. 360, eq. 9.1.16 (Wronskian). - Wolfdieter Lang, Mar 05 2013
Limit_{n->oo} a(n)/n! = BesselJ(1,2) = 0.576724807756873... See a comment on asymptotics under A084950.
a(n) = n!*hypergeometric([1/2-n/2, 1-n/2], [2, 1-n, -n], -4) for n >= 2. - Peter Luschny, Sep 10 2014

Extensions

New description from Amarnath Murthy, Aug 17 2002

A007060 Number of ways n married couples can sit in a row without any spouses next to each other.

Original entry on oeis.org

1, 0, 8, 240, 13824, 1263360, 168422400, 30865121280, 7445355724800, 2287168006717440, 871804170613555200, 403779880746418176000, 223346806774106790297600, 145427383048755178635264000, 110105698060190464791596236800, 95914116314126658718742347776000, 95252504853751428295192341381120000
Offset: 0

Views

Author

David Roberts Keeney (David.Roberts.Keeney(AT)directory.Reed.edu)

Keywords

Comments

Limit_{n->oo} a(n)/(2n)! = 1/e.
Also the number of (directed) Hamiltonian paths of the n-cocktail party graph. - Eric W. Weisstein, Dec 16 2013
Also the number of ways to label the cells of a 2 X n grid such that no vertically adjacent cells have adjacent labels. - Sela Fried, May 29 2023

Examples

			For n = 2, the a(2) = 8 solutions for the couples {1,2} and {3,4} are {1324, 1423, 2314, 2413, 3142, 3241, 4132, 4231}.
		

Crossrefs

Programs

  • Maple
    seq(add((-1)^i*binomial(n, i)*2^i*(2*n-i)!, i=0..n),n=0..20);
  • Mathematica
    Table[Sum[(-1)^i Binomial[n,i] (2 n - i)! 2^i, {i, 0, n}], {n, 0, 20}]
    Table[(2 n)! Hypergeometric1F1[-n, -2 n, -2], {n, 0, 20}]
  • PARI
    a(n)=sum(k=0, n, binomial(n, k)*(-1)^(n-k)*(n+k)!*2^(n-k)) \\ Charles R Greathouse IV, May 11 2016
    
  • Python
    from sympy import binomial, subfactorial
    def a(n): return sum([(-1)**(n - k)*binomial(n, k)*subfactorial(2*k) for k in range(n + 1)]) # Indranil Ghosh, Apr 28 2017

Formula

a(n) = (Pi*BesselI(n+1/2,1)*(-1)^n+BesselK(n+1/2,1))*exp(-1)*(2/Pi)^(1/2)*2^n*n!. - Mark van Hoeij, Nov 12 2009
a(n) = (-1)^n*2^n*n!*A000806(n), n>0. - Vladeta Jovovic, Nov 19 2009
a(n) = n!*hypergeom([-n, n+1],[],1/2)*(-2)^n. - Mark van Hoeij, Nov 13 2009
a(n) = 2^n * A114938(n). - Toby Gottfried, Nov 22 2010
a(n) = 2*n((2*n-1)*a(n-1) + (2*n-2)*a(n-2)), n > 1. - Aaron Meyerowitz, May 14 2014
From Peter Bala, Mar 06 2015: (Start)
a(n) = Sum_{k = 0..n} (-1)^(n-k)*binomial(n,k)*A000166(2*k).
For n >= 1, Integral_{x = 0..1} (x^2 - 1)^n*exp(x) dx = a(n)*e - A177840(n). Hence lim_{n->oo} A177840(n)/a(n) = e. (End)
a(n) ~ sqrt(Pi) * 2^(2*n+1) * n^(2*n + 1/2) / exp(2*n+1). - Vaclav Kotesovec, Mar 09 2016

Extensions

More terms from Michel ten Voorde, Apr 11 2001

A053983 a(n) = (2*n-1)*a(n-1) - a(n-2), a(0)=a(1)=1.

Original entry on oeis.org

1, 1, 2, 9, 61, 540, 5879, 75887, 1132426, 19175355, 363199319, 7608010344, 174621038593, 4357917954481, 117489163732394, 3402827830284945, 105370173575100901, 3473812900148044788, 121478081331606466679, 4491215196369291222335, 175035914577070751204386
Offset: 0

Views

Author

Vladeta Jovovic, Apr 02 2000

Keywords

Comments

Denominators of successive convergents to tan(1) using continued fraction 1/(1-1/(3-1/(5-1/(7-1/(9-1/(11-1/(13-1/15-...))))))). - Michael Somos, Aug 07 2000
Equals eigensequence of an infinite lower triangular matrix with (1, 3, 5, ...) as the main diagonal and (-1, -1, -1, ...) as the subdiagonal. - Gary W. Adamson, Apr 20 2009

Examples

			a(10) = 363199319 because 1/(1-1/(3-1/(5-1/(7-1/(9-1/(11-1/(13-1/(15-1/(17-1/19))))))))) = 565649425/363199319.
		

Crossrefs

Programs

  • Magma
    [1] cat [ n le 2 select n else (2*n-1)*Self(n-1)-Self(n-2): n in [1..25] ]; // Vincenzo Librandi, Mar 08 2015
  • Maple
    E(x):=sin(1)*cos(sqrt(1-2*x))-cos(1)*sin(sqrt(1-2*x)): f[0]:=E(x): for n from 1 to 30 do f[n]:=diff(f[n-1],x) od: x:=0: for n from 1 to 30 do f[n]:=simplify(f[n]/(sin(1)^2+cos(1)^2)) od: seq(f[n],n=1..30); # Miklos Kristof, Jun 15 2005
  • Mathematica
    RecurrenceTable[{a[0]==a[1]==1,a[n]==(2n-1)a[n-1]-a[n-2]},a,{n,20}] (* Harvey P. Dale, Dec 21 2011 *)
    CoefficientList[Series[Cos[1-Sqrt[1-2*x]]/Sqrt[1-2*x], {x, 0, 20}], x] * Range[0, 20]! (* Vaclav Kotesovec, Jul 31 2014 *)
  • PARI
    a(n)={if(n<2,1,(2*n-1)*a(n-1)-a(n-2))} \\ Edward Jiang, Sep 10 2014
    
  • PARI
    {a(n) = my(a0, a1, s=n<0); if( n>-3 && n<1, return(n+1)); if( n<0, n=-1-n); a0=1-s; a1=1; for(k=2, n, a2 = (2*k-1)*a1 - a0; a0=a1; a1=a2); (-1)^(s*n) * a1}; /* Michael Somos, Sep 11 2014 */
    
  • Sage
    def A053983(n):
        if n < 2: return 1
        return 2^n*gamma(n+1/2)*hypergeometric([1/2-n/2, -n/2], [1/2, 1/2-n, -n], -1)/sqrt(pi)
    [round(A053983(n).n(100)) for n in (0..20)] # Peter Luschny, Sep 10 2014
    

Formula

a(n) = -(-1)^n*A053984(-1-n). - Michael Somos, Aug 07 2000
E.g.f.: cos(1-sqrt(1-2*x))/sqrt(1-2*x). If a(0)=0, a(n)=0, 1, 1, 2, 9, 61, 540, 5879, 75887, 1132426, ... then e.g.f. = sin(1)*cos(sqrt(1-2*x))-cos(1)*sin(sqrt(1-2*x)). - Miklos Kristof, Jun 15 2005, corrected by Vaclav Kotesovec, Jul 31 2014
a(n) = Sum_{k=0..floor(n/2)} (-1)^k*2^(n-2*k)*(n-2*k)!*binomial(n-k,k) * binomial(n-k-1/2,k-1/2). Cf. A058798. - Peter Bala, Aug 01 2013
a(n) ~ cos(1) * 2^(n+1/2) * n^n / exp(n). - Vaclav Kotesovec, Jul 31 2014
a(n) = 2^n*Gamma(n+1/2)*hypergeometric([1/2-n/2, -n/2], [1/2, 1/2-n, -n], -1)/sqrt(Pi) for n >= 2. - Peter Luschny, Sep 10 2014
0 = a(n)*(+a(n+2)) + a(n+1)*(-a(n+1) + 2*a(n+2) - a(n+3)) + a(n+2)*(+a(n+2)) for all n in Z. - Michael Somos, Sep 11 2014
(1/(2^n*n!)) * Integral_{x = 0..1} (1 - x^2)^n*cos(x) dx = a(n)*sin(1) - A053984(n)*cos(1). Hence A053984(n)/a(n) -> tan(1) as n -> infinity. - Peter Bala, Mar 06 2015
a(n) = SphericalBesselJ[0,1]*SphericalBesselJ[n,1] + SphericalBesselY[0,1]*SphericalBesselY[n,1]. - G. C. Greubel, May 10 2015
Sum_{n>0} a(n-1) t^n/n! = sin(1 - sqrt(1-2t)). - G. C. Greubel, May 10 2015

Extensions

Additional comments from Michael Somos, Aug 23 2000
More terms from Miklos Kristof, Jun 15 2005

A121323 a(n) = (2*n+1)*a(n-1) - a(n-2) starting a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 5, 34, 301, 3277, 42300, 631223, 10688491, 202450106, 4240763735, 97335115799, 2429137131240, 65489367427681, 1896762518271509, 58734148698989098, 1936330144548368725, 67712820910493916277, 2503438043543726533524, 97566370877294840891159
Offset: 0

Views

Author

Roger L. Bagula and Bob Hanlon (hanlonr(AT)cox.net), Sep 05 2006

Keywords

Crossrefs

Programs

  • Maple
    A121323 := proc(n)
        BesselJ(3/2+n,1)*BesselY(3/2,1)-BesselJ(3/2,1)*BesselY(3/2+n,1) ;
        simplify(Pi*%/2 );
    end proc: # R. J. Mathar, Oct 13 2012
  • Mathematica
    f[n_Integer] = Module[{a}, a[n] /. RSolve[{a[n] == (2*n + 1)*a[n - 1] - a[n - 2], a[0] == 0, a[1] == 1}, a[n], n][[1]] // FullSimplify] Rationalize[N[Table[f[n], {n, 0, 25}], 100], 0]
    CoefficientList[Series[((Sqrt[1-2*x]+1)*Sin[1-Sqrt[1-2*x]]+(Sqrt[1-2*x]-1)*Cos[1-Sqrt[1-2*x]])/(1-2*x)^(3/2),{x,0,20}],x]*Range[0,20]! (* Vaclav Kotesovec, Oct 21 2012 *)
    nxt[{n_,a_,b_}]:={n+1,b,(2n+3)b-a}; NestList[nxt,{1,0,1},20][[All,2]] (* Harvey P. Dale, Sep 04 2021 *)
  • Sage
    def A121323(n):
        if n < 2: return n
        return 2^(n+1)*gamma(n+3/2)*hypergeometric([1/2-n/2, 1-n/2], [5/2, -n-1/2, 1-n],-1) /(3*sqrt(pi))
    [round(A121323(n).n(100)) for n in (0..19)] # Peter Luschny, Sep 10 2014

Formula

2*a(n)= Pi*BesselJ_{3/2 + n}(1) * BesselY_{3/2}(1) - Pi*BesselJ_{3/2}(1) *BesselY_{3/2 + n}(1).
E.g.f.: ((sqrt(1-2*x)+1)*sin(1-sqrt(1-2*x))+(sqrt(1-2*x)-1)*cos(1-sqrt(1-2*x)))/(1-2*x)^(3/2). - Vaclav Kotesovec, Oct 21 2012
a(n) ~ (sin(1)-cos(1))*n^(n+1)*2^(n+3/2)/exp(n). - Vaclav Kotesovec, Oct 21 2012
a(n) = Sum_{k = 0..floor((n-1)/2)} (-1)^k*2^(n-2*k-1)*(n-2*k-1)!*binomial(n-k-1,k)*binomial(n-k+1/2,k+3/2), cf. A058798. - Peter Bala, Aug 01 2013
a(n) = 2^(n+1)*Gamma(n+3/2)*hypergeometric([1/2-n/2, 1-n/2], [5/2, -n-1/2, 1-n], -1)/(3*sqrt(Pi)) for n >= 2. - Peter Luschny, Sep 10 2014

A121353 a(n) = (3*n - 2)*a(n-1) - a(n-2) starting a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 4, 27, 266, 3431, 54630, 1034539, 22705228, 566596161, 15841987280, 490535009519, 16662348336366, 616016353436023, 24623991789104554, 1058215630578059799, 48653295014801646200, 2382953240094702604001, 123864915189909733761852, 6810187382204940654297859
Offset: 0

Views

Author

Roger L. Bagula and Bob Hanlon (hanlonr(AT)cox.net), Sep 05 2006

Keywords

Comments

In the hypergeometric family a(n) = (a0*n+c0)*a(n-1)+b0*a(n-2) we have A053984, A058797, A121323, A121351, and this here with a0=3, where a(n) can be expressed in a characteristic cross-product of Bessel functions.

Crossrefs

Programs

  • Mathematica
    f[n_Integer] = Module[{a}, a[n] /. RSolve[{a[n] == (3*n - 2)*a[n - 1] - a[n - 2], a[0] == 0, a[1] == 1}, a[n], n][[1]] // FullSimplify] Rationalize[N[Table[f[n], {n, 0, 25}], 100], 0]
    RecurrenceTable[{a[0]==0, a[1]==1, a[n]==(3n-2)*a[n-1]-a[n-2]}, a, {n, 20}]  (* Vaclav Kotesovec, Jul 31 2014 *)
    nxt[{n_,a_,b_}]:={n+1,b,b(3n+1)-a}; NestList[nxt,{1,0,1},20][[;;,2]] (* Harvey P. Dale, Jun 03 2023 *)
  • Sage
    def A121353(n):
        if n < 2: return n
        return 3^n*gamma(n+1/3)*hypergeometric([1/2-n/2,1-n/2], [4/3, 2/3 -n, 1-n], -4/9)/gamma(1/3)
    [round(A121353(n).n(100)) for n in (0..19)] # Peter Luschny, Sep 10 2014

Formula

a(n) = (Pi/3) * (BesselJ(1/3+n,2/3) * BesselY(1/3,2/3) - BesselJ(1/3,2/3) * BesselY(1/3+n,2/3)).
a(n) = Sum_{k = 0..floor((n-1)/2)} (-1)^k*3^(n-2*k-1)*(n-2*k-1)!*binomial(n-k-1,k)*binomial(n-k-2/3,k+1/3), cf. A058798. - Peter Bala, Aug 01 2013
a(n) ~ n! * BesselJ(1/3, 2/3) * 3^(n-2/3) * n^(-2/3). - Vaclav Kotesovec, Jul 31 2014
a(n) = 3^n*Gamma(n+1/3)*hypergeometric([1/2-n/2, 1-n/2], [4/3, 2/3-n, 1-n], -4/9)/Gamma(1/3) for n >= 2. - Peter Luschny, Sep 10 2014

A121351 a(n) = (3*n+1)*a(n-1) - a(n-2), starting a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 7, 69, 890, 14171, 268359, 5889727, 146974816, 4109405121, 127244583935, 4322206448669, 159794394016818, 6387453554224051, 274500708437617375, 12620645134576175199, 618137110885794967376, 32130509120926762128353
Offset: 0

Views

Author

Roger L. Bagula and Bob Hanlon (hanlonr(AT)cox.net), Sep 05 2006

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_Integer] = Module[{a}, a[n] /. RSolve[{a[n] == (3*n + 1)*a[n - 1] - a[n - 2], a[0] == 0, a[1] == 1}, a[n], n][[1]] // FullSimplify] Rationalize[N[Table[f[n], {n, 0, 25}], 100], 0]
    RecurrenceTable[{a[0]==0, a[1]==1, a[n]==(3n+1)*a[n-1]-a[n-2]}, a, {n, 20}]  (* Vaclav Kotesovec, Jul 31 2014 *)
    nxt[{n_,a_,b_}]:={n+1,b,(3n+4)b-a}; NestList[nxt,{1,0,1},20][[All,2]] (* Harvey P. Dale, Jun 20 2021 *)

Formula

3*a(n)= Pi*BesselJ_{4/3 + n}(2/3)* BesselY_{4/3}(2/3) - Pi*BesselJ_{4/3}(2/3) * BesselY_{4/3 + n}(2/3).
a(n) = sum {k = 0..floor((n-1)/2)} (-1)^k*3^(n-2*k-1)*(n-2*k-1)!*binomial(n-k-1,k)*binomial(n-k+1/3,k+4/3), cf. A058798. - Peter Bala, Aug 01 2013
a(n) ~ n! * BesselJ(4/3, 2/3) * 3^(n+1/3) * n^(1/3). - Vaclav Kotesovec, Jul 31 2014

A121354 a(n) = (3*n-1)*a(n-1) - a(n-2).

Original entry on oeis.org

0, 1, 5, 39, 424, 5897, 99825, 1990603, 45684044, 1185794541, 34342357645, 1097769650099, 38387595395820, 1457630855391061, 59724477475637681, 2626419378072666903, 123381986291939706760, 6166472895218912671097, 326699681460310431861381, 18289015688882165271566239
Offset: 0

Views

Author

Roger L. Bagula and Bob Hanlon (hanlonr(AT)cox.net), Sep 05 2006

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_Integer] = Module[{a}, a[n] /. RSolve[{a[n] == (3*n - 1)*a[n - 1] - a[n - 2], a[0] == 0, a[1] == 1}, a[n], n][[1]] // FullSimplify] Rationalize[N[Table[f[n], {n, 0, 25}], 100], 0]
    RecurrenceTable[{a[0]==0,a[1]==1,a[n]==(3n-1)a[n-1]-a[n-2]},a,{n,20}] (* Harvey P. Dale, Jul 29 2014 *)
  • Python
    from sympy import cacheit
    @cacheit
    def A121354(n):
        if n <= 1:
            return n
        else:
            return (3*n-1)*A121354(n-1)-A121354(n-2)
    print([A121354(n) for n in range(20)]) # Oct 14 2009
    
  • Sage
    def A121354(n):
        if n < 2: return n
        return 3^(n-1)*gamma(n+2/3)*hypergeometric([1/2-n/2, 1-n/2], [5/3, 1/3-n, 1-n], -4/9) /gamma(5/3)
    [round(A121354(n).n(100)) for n in (0..19)] # Peter Luschny, Sep 10 2014

Formula

a(n) = Pi* ( J_{n+2/3}(2/3) * Y_{2/3}(2/3) - J_{2/3}(2/3)* Y_{n+2/3}(2/3) )/3 , where J and Y are Bessel functions.
a(n) = Sum_{k = 0..floor((n-1)/2)} (-1)^k*3^(n-2*k-1)*(n-2*k-1)!*binomial(n-k-1,k)*binomial(n-k-1/3,k+2/3), cf. A058798. - Peter Bala, Aug 01 2013
a(n) ~ BesselJ(2/3, 2/3) * sqrt(2*Pi) * 3^(n-1/3) * n^(n+1/6) / exp(n). - Vaclav Kotesovec, Jul 31 2014
a(n) = 3^(n-1)*Gamma(n+2/3)*hypergeometric([1/2-n/2, 1-n/2], [5/3, 1/3-n, 1-n], -4/9)/Gamma(5/3) for n >= 2. - Peter Luschny, Sep 10 2014

Extensions

Offset corrected by the Associate Editors of the OEIS - Oct 14 2009

A177840 Consider the n pairs (1,2), ..., (2n-1,2n); a(n) is the number of permutations of [ 2n ] with no two fixed points for any pair.

Original entry on oeis.org

1, 1, 21, 653, 37577, 3434169, 457819549, 83900098309, 20238575173137, 6217167231292913, 2369809434953636261, 1097587512530348834301, 607119566298408076479961, 395312612701784187384578473, 299298318246814086742418737197, 260721599469397754183307347278709
Offset: 0

Views

Author

Paul Weisenhorn, May 14 2010

Keywords

Comments

Inverse binomial transform of (2n)!. - Peter Luschny, May 31 2014
Also, the number of permutations of [2n] with no two cycle (2i-1,2i) for any pair. The number of permutation where no such pair is exchanged or fixed pointwise is A116218. - Aaron Meyerowitz, Jul 22 2023

Examples

			a(2) = 21, because there are 4! = 24 permutations of [ 4 ], only 3 of them have pairs with 2 fixed points: [1,2,3,4], [1,2,4,3], [2,1,3,4].
a(3) = A(3,0) = 653, A(3,1) = 63, A(3,2) = 3, A(3,4) = 1, sum = 720 = 6!.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember;
          `if`(n<2, 1-n, (n-1) *(f(n-1)+f(n-2)))
        end:
    a:= n-> add(binomial(n,j) *2^j *f(2*n-j), j=0..n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Sep 06 2011
  • Mathematica
    f[n_] := f[n] = If[n<2, 1-n, (n-1)*(f[n-1]+f[n-2])]; a[n_] := Sum[Binomial[ n, j]*2^j*f[2*n-j], {j, 0, n}]; Table[a[n], {n, 1, 20}] (* Jean-François Alcover, Feb 25 2017, after Alois P. Heinz *)

Formula

a(n) = Sum_{j=0..n} C(n,j) * 2^j * f(2*n-j), where f(n) is the number of permutations of [n] with no fixed-points (A000166).
a(n) = A(n,0), with A(n,s) = number of permutations of [2n] with exactly s pairs with 2 fixed points:
A(n,s) = (n!/s!) * Sum_{j=0..n-s} 1/(j!*(n-s-j)!) * 2^j * f(2*(n-s)-j).
A(n,n) = 1, A(n,n-1) = n, A(n,n-2) = 21*n!/(2*(n-2)!).
Sum_{s=0..n} A(n,s) = (2*n)!.
a(n) = Sum_{j=0..n} C(n,j)*(2*n-2*j)!*(-1)^j. - Tani Akinari, Feb 01 2015
A(n,s) = Sum_{j=s..n} C(n,j)*C(j,s)*(2*n-2*j)!*(-1)^(j-s). - Tani Akinari, Feb 01 2015
From Peter Bala, Mar 07 2015: (Start)
a(n) = Integral_{x = 0..oo} (x^2 - 1)^n*exp(-x) dx.
For n >= 1, Integral_{x = 0..1} (x^2 - 1)^n*exp(x) dx = A007060(n)*e - a(n). Hence lim_{n->oo} a(n)/A007060(n) = e.
O.g.f. with a(0) := 1: Sum_{k >= 0} (2*k)!*x^k/(1 + x)^(k + 1) = 1 + x + 21*x^2 + 653*x^3 + ....
a(n) = 2*n*(2*n - 1)*a(n-1) + 4*n*(n - 1)*a(n-2) + (-1)^n, with initial conditions a(0) = 1, a(1) = 1.
Homogeneous recurrence: a(n) = (4*n^2 - 2*n - 1)*a(n-1) + 2*(n - 1)*(4*n - 3)*a(n-2) + 4*(n - 1)*(n - 2)*a(n-3), with initial conditions a(0) = 1, a(1) = 1 and a(2) = 21. Cf. A064570. (End)
a(n) ~ sqrt(Pi) * 2^(2*n+1) * n^(2*n + 1/2) / exp(2*n). - Vaclav Kotesovec, Mar 10 2015
a(n) = (2*n)!*hypergeom([],[1/2-n],1/4)+(-1)^n*(1-hypergeom([1],[1/2,n+1],1/4)). - Peter Luschny, Mar 15 2015

Extensions

b-file changed to a-file by N. J. A. Sloane, Oct 05 2010
Edited by Alois P. Heinz, Sep 06 2011
a(0)=1 prepended by Alois P. Heinz, Jul 23 2023

A334823 Triangle, read by rows, of Lambert's denominator polynomials related to convergents of tan(x).

Original entry on oeis.org

1, 1, 0, 3, 0, -1, 15, 0, -6, 0, 105, 0, -45, 0, 1, 945, 0, -420, 0, 15, 0, 10395, 0, -4725, 0, 210, 0, -1, 135135, 0, -62370, 0, 3150, 0, -28, 0, 2027025, 0, -945945, 0, 51975, 0, -630, 0, 1, 34459425, 0, -16216200, 0, 945945, 0, -13860, 0, 45, 0, 654729075, 0, -310134825, 0, 18918900, 0, -315315, 0, 1485, 0, -1
Offset: 0

Views

Author

G. C. Greubel, May 12 2020, following a suggestion from Michel Marcus

Keywords

Comments

Lambert's numerator polynomials related to convergents of tan(x), g(n, x), are given in A334824.

Examples

			Polynomials:
f(0, x) = 1;
f(1, x) = x;
f(2, x) = 3*x^2 - 1;
f(3, x) = 15*x^3 - 6*x;
f(4, x) = 105*x^4 - 45*x^2 + 1;
f(5, x) = 945*x^5 - 420*x^3 + 15*x;
f(6, x) = 10395*x^6 - 4725*x^4 + 210*x^2 - 1;
f(7, x) = 135135*x^7 - 62370*x^5 + 3150*x^3 - 28*x;
f(8, x) = 2027025*x^8 - 945945*x^6 + 51975*x^4 - 630*x^2 + 1.
Triangle of coefficients begins as:
        1;
        1, 0;
        3, 0,      -1;
       15, 0,      -6, 0;
      105, 0,     -45, 0,     1;
      945, 0,    -420, 0,    15, 0;
    10395, 0,   -4725, 0,   210, 0,   -1;
   135135, 0,  -62370, 0,  3150, 0,  -28, 0;
  2027025, 0, -945945, 0, 51975, 0, -630, 0, 1.
		

Crossrefs

Columns k: A001147 (k=0), A001879 (k=2), A001880 (k=4), A038121 (k=6).

Programs

  • Magma
    C := ComplexField();
    T:= func< n, k| Round( i^k*Factorial(2*n-k)*(1+(-1)^k)/(2^(n-k+1)*Factorial(k)*Factorial(n-k)) ) >;
    [T(n,k): k in [0..n], n in [0..10]];
    
  • Maple
    T:= (n, k) -> I^k*(2*n-k)!*(1+(-1)^k)/(2^(n-k+1)*(k)!*(n-k)!);
    seq(seq(T(n, k), k = 0 .. n), n = 0 .. 10);
  • Mathematica
    (* First program *)
    y[n_, x_]:= Sqrt[2/(Pi*x)]*E^(1/x)*BesselK[-n -1/2, 1/x];
    f[n_, k_]:= Coefficient[((-I)^n/2)*(y[n, I*x] + (-1)^n*y[n, -I*x]), x, k];
    Table[f[n, k], {n,0,10}, {k,n,0,-1}]//Flatten
    (* Second program *)
    Table[ I^k*(2*n-k)!*(1+(-1)^k)/(2^(n-k+1)*(k)!*(n-k)!), {n,0,10}, {k,0,n}]//Flatten
  • Sage
    [[ i^k*factorial(2*n-k)*(1+(-1)^k)/(2^(n-k+1)*factorial(k)*factorial(n-k)) for k in (0..n)] for n in (0..10)]

Formula

Equals the coefficients of the polynomials, f(n, x), defined by: (Start)
f(n, x) = Sum_{k=0..floor(n/2)} ((-1)^k*(2*n-2*k)!/((2*k)!*(n-2*k)!))*(x/2)^(n-2*k).
f(n, x) = ((2*n)!/n!)*(x/2)^n*Hypergeometric2F3(-n/2, (1-n)/2; 1/2, -n, -n+1/2; -1/x^2).
f(n, x) = ((-i)^n/2)*(y(n, i*x) + (-1)^n*y(n, -i*x)), where y(n, x) are the Bessel Polynomials.
f(n, x) = (2*n-1)*x*f(n-1, x) - f(n-2, x).
E.g.f. of f(n, x): cos((1 - sqrt(1-2*x*t))/2)/sqrt(1-2*x*t).
f(n, 1) = (-1)^n*f(n, -1) = A053983(n) = (-1)^(n+1)*A053984(-n-1) = (-1)^(n+1) * g(-n-1, 1).
f(n, 2) = (-1)^n*f(n, -2) = A053988(n+1). (End)
As a number triangle:
T(n, k) = i^k*(2*n-k)!*(1+(-1)^k)/(2^(n-k+1)*(k)!*(n-k)!), where i = sqrt(-1).
T(n, 0) = A001147(n).

A334824 Triangle, read by rows, of Lambert's numerator polynomials related to convergents of tan(x).

Original entry on oeis.org

1, 3, 0, 15, 0, -1, 105, 0, -10, 0, 945, 0, -105, 0, 1, 10395, 0, -1260, 0, 21, 0, 135135, 0, -17325, 0, 378, 0, -1, 2027025, 0, -270270, 0, 6930, 0, -36, 0, 34459425, 0, -4729725, 0, 135135, 0, -990, 0, 1, 654729075, 0, -91891800, 0, 2837835, 0, -25740, 0, 55, 0, 13749310575, 0, -1964187225, 0, 64324260, 0, -675675, 0, 2145, 0, -1
Offset: 0

Author

G. C. Greubel, May 13 2020, following a suggestion from Michel Marcus

Keywords

Comments

Lambert's denominator polynomials related to convergents of tan(x), f(n, x), are given in A334823.

Examples

			Polynomials:
g(0, x) = 1;
g(1, x) = 3*x;
g(2, x) = 15*x^2 - 1;
g(3, x) = 105*x^3 - 10*x;
g(4, x) = 945*x^4 - 105*x^2 + 1;
g(5, x) = 10395*x^5 - 1260*x^3 + 21*x;
g(6, x) = 135135*x^6 - 17325*x^4 + 378*x^2 - 1;
g(7, x) = 2027025*x^7 - 270270*x^5 + 6930*x^3 - 36*x.
Triangle of coefficients begins as:
        1;
        3, 0;
       15, 0,      -1;
      105, 0,     -10, 0;
      945, 0,    -105, 0,    1;
    10395, 0,   -1260, 0,   21, 0;
   135135, 0,  -17325, 0,  378, 0,  -1;
  2027025, 0, -270270, 0, 6930, 0, -36, 0.
		

Crossrefs

Columns k: A001147 (k=0), A000457 (k=2), A001881 (k=4), A130563 (k=6).

Programs

  • Magma
    C := ComplexField();
    T:= func< n, k| Round( i^k*Factorial(2*n-k+1)*(1+(-1)^k)/(2^(n-k+1)*Factorial(k+1)*Factorial(n-k)) ) >;
    [T(n,k): k in [0..n], n in [0..10]];
    
  • Maple
    T:= (n, k) -> I^k*(2*n-k+1)!*(1+(-1)^k)/(2^(n-k+1)*(k+1)!*(n-k)!);
    seq(seq(T(n, k), k = 0..n), n = 0..10);
  • Mathematica
    (* First program *)
    y[n_, x_]:= Sqrt[2/(Pi*x)]*E^(1/x)*BesselK[-n -1/2, 1/x];
    g[n_, k_]:= Coefficient[((-I)^n/2)*(y[n+1, I*x] + (-1)^n*y[n+1, -I*x]), x, k];
    Table[g[n, k], {n,0,10}, {k,n,0,-1}]//Flatten
    (* Second program *)
    Table[I^k*(2*n-k+1)!*(1+(-1)^k)/(2^(n-k+1)*(k+1)!*(n-k)!), {n,0,10}, {k,0,n}]//Flatten
  • Sage
    [[ i^k*factorial(2*n-k+1)*(1+(-1)^k)/(2^(n-k+1)*factorial(k+1)*factorial(n-k)) for k in (0..n)] for n in (0..10)]

Formula

Equals the coefficients of the polynomials, g(n, x), defined by: (Start)
g(n, x) = Sum_{k=0..floor(n/2)} ((-1)^k*(2*n-2*k+1)!/((2*k+1)!*(n-2*k)!))*(x/2)^(n-2*k).
g(n, x) = ((2*n+1)!/n!)*(x/2)^n*Hypergeometric2F3(-n/2, (1-n)/2; 3/2, -n, -n-1/2; -1/x^2).
g(n, x) = ((-i)^n/2)*(y(n+1, i*x) + (-1)^n*y(n+1, -i*x)), where y(n, x) are the Bessel Polynomials.
g(n, x) = (2*n-1)*x*g(n-1, x) - g(n-2, x).
E.g.f. of g(n, x): sin((1 - sqrt(1-2*x*t))/2)/sqrt(1-2*x*t).
g(n, 1) = (-1)^n*g(n, -1) = A053984(n) = (-1)^n*A053983(-n-1) = (-1)^n*f(-n-1, 1).
g(n, 2) = (-1)^n*g(n, -2) = A053987(n+1). (End)
As a number triangle:
T(n, k) = i^k*(2*n-k+1)!*(1+(-1)^k)/(2^(n-k+1)*(k+1)!*(n-k)!), where i = sqrt(-1).
T(n, 0) = A001147(n+1).
Showing 1-10 of 12 results. Next