A340737 Numerators of a sequence of fractions converging to e.
3, 5, 19, 49, 193, 685, 2721, 12341, 49171, 271801, 1084483, 7073725, 28245729, 212385209, 848456353, 7226001865, 28875761731, 274743964621, 1098127402131, 11544775603241, 46150226651233, 531276670190245, 2124008553358849, 26573182030311229, 106246577894593683, 1435390805853694145
Offset: 1
Examples
Sequence of fractions begins 3/1, 5/2, 19/7, 49/18, 193/71, 685/252, 2721/1001, 12341/4540, ...
Programs
-
Maple
e:=proc(a,b,n)option remember; e(a,b,1):=a; e(a,b,2):=b; if n>2 and n mod 2 =1 then 2*e(a,b,n-1)+n*e(a,b,n-2) else if n>3 and n mod 2 = 0 then (n+2)*e(a,b,n-1)/2 -(e(a,b,n-2)+(n-2)*e(a,b,n-3)/2) fi fi end seq(e(3,5,n), n = 1..20) # code to print the sequence of fractions and error for n from 1` to 20 do print(e(3,5,n)/e(1,2,n), evalf(exp(1)-e(3,5,n)/e(1,2,n)) od
-
Mathematica
a[1] = 3; a[2] = 5; a[n_] := a[n] = If[EvenQ[n], (n + 2)*a[n - 1]/2 - (a[n - 2] + (n - 2)*a[n - 3]/2), 2*a[n - 1] + n*a[n - 2]]; Array[a, 20] (* Amiram Eldar, Jan 18 2021 *)
Formula
a(1) = 3, a(2) = 5; for n > 2, a(n) = (n+2)*a(n-1)/2 - a(n-2) - (n-2)*a(n-3)/2 if n is even, 2*a(n-1) + n*a(n-2) otherwise.
Comments