The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A056889 Numerators of continued fraction for left factorial. 2

%I

%S 0,1,1,0,1,-1,-2,1,2,-1,-3,2,9,-7,-40,33,224,-191,-1495,1304,11545,

%T -10241,-101106,90865,989274,-898409,-10690043,9791634,126392833,

%U -116601199,-1622625152,1506023953,22473758096,-20967734143,-333977722335,313009988192,5300202065121,-4987192076929

%N Numerators of continued fraction for left factorial.

%H G. C. Greubel, <a href="/A056889/b056889.txt">Table of n, a(n) for n = 0..900</a>

%F a(0) = 0; 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).

%F From _Mark van Hoeij_, Jul 15 2022: (Start)

%F a(2*n+1) = -(-1)^n * A058797(n-2).

%F a(2*n) = (-1)^n * (A058797(n-2) + A058797(n-3)). (End)

%p a:= proc(n) option remember;

%p if n<2 then n

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

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

%p fi; end:

%p seq(a(n), n=0..40); # _G. C. Greubel_, Dec 05 2019

%t a[n_]:= a[n]= If[n<2, 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 *)

%o (PARI) a(n) = if(n<2, 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

%o (Sage)

%o @CachedFunction

%o def a(n):

%o if (n<2): return n

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

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

%o [a(n) for n in (0..40)] # _G. C. Greubel_, Dec 05 2019

%o (GAP)

%o a:= function(n)

%o if n<2 then return n;

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

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

%o fi; end;

%o List([0..20], n-> a(n) ); # _G. C. Greubel_, Dec 05 2019

%Y Cf. A056890, A058797.

%K sign,frac,easy

%O 0,7

%A _Aleksandar Petojevic_, Sep 05 2000

%E More terms from _James A. Sellers_, Sep 06 2000 and from Larry Reeves (larryr(AT)acm.org), Sep 07 2000

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

Last modified February 5 08:15 EST 2023. Contains 360082 sequences. (Running on oeis4.)