login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A056890 Denominators of continued fraction for left factorial. 2
1, -1, 0, -1, -2, 1, 1, 0, 1, -1, -4, 3, 14, -11, -63, 52, 353, -301, -2356, 2055, 18194, -16139, -159335, 143196, 1559017, -1415821, -16846656, 15430835, 199185034, -183754199, -2557127951, 2373373752, 35416852081, -33043478329, -526322279512, 493278801183, 8352696141782 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

LINKS

G. C. Greubel, Table of n, a(n) for n = 0..900

FORMULA

a(0)=1; a(1)=-1; a(2*n)=n*a(2*n-1)+a(2*n-2); a(2*n+1)= - a(2*n)+a(2*n-1)

MAPLE

a:= proc(n) option remember;

      if n<2 then (-1)^n

    elif (n mod 2)=0 then (n/2)*a(n-1) +a(n-2)

    else -a(n-1) +a(n-2)

      fi; end:

seq(a(n), n=0..40); # G. C. Greubel, Dec 05 2019

MATHEMATICA

a[n_]:= a[n]= If[n<2, (-1)^n, If[EvenQ[n], (n/2)*a[n-1] +a[n-2], -a[n-1] +a[n-2]]]; Table[a[n], {n, 0, 40}] (* G. C. Greubel, Dec 05 2019 *)

PROG

(PARI) a(n) = if(n<2, (-1)^n, if(Mod(n, 2)==0, (n/2)*a(n-1) +a(n-2), -a(n-1) +a(n-2) )); \\ G. C. Greubel, Dec 05 2019

(Sage)

@CachedFunction

def a(n):

    if (n<2): return (-1)^n

    elif (mod(n, 2) ==0): return (n/2)*a(n-1) +a(n-2)

    else: return -a(n-1) +a(n-2)

[a(n) for n in (0..40)] # G. C. Greubel, Dec 05 2019

(GAP)

a:= function(n)

    if n<2 then return (-1)^n;

    elif (n mod 2)=0 then return (n/2)*a(n-1) +a(n-2);

    else return -a(n-1) +a(n-2);

    fi; end;

List([0..20], n-> a(n) ); # G. C. Greubel, Dec 05 2019

CROSSREFS

Cf. A056889.

Sequence in context: A294446 A318163 A114640 * A321519 A346392 A169590

Adjacent sequences:  A056887 A056888 A056889 * A056891 A056892 A056893

KEYWORD

sign,frac,easy

AUTHOR

Aleksandar Petojevic (apetoje(AT)ptt.yu), Sep 05 2000

EXTENSIONS

More terms from James A. Sellers, Sep 06 2000 and from Larry Reeves (larryr(AT)acm.org), Sep 07 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 30 15:30 EST 2021. Contains 349420 sequences. (Running on oeis4.)