OFFSET
1,3
LINKS
Stanislav Sykora, Table of n, a(n) for n = 1..670
S. Sykora, Blazys' Expansions and Continued Fractions, Stans Library, Vol.IV, 2013, DOI 10.3247/sl4math13.001
S. Sykora, PARI/GP scripts for Blazys expansions and fractions, OEIS Wiki
FORMULA
1/gamma = 1+1/(1+1/(2+2/(2+2/(2+2/(2+2/(4+4/(12+...))))))).
MATHEMATICA
BlazysExpansion[n_, mx_] := Block[{k = 1, x = n, lmt = mx + 1, s, lst = {}}, While[k < lmt, s = Floor[x]; x = 1/(x/s - 1); AppendTo[lst, s]; k++]; lst]; BlazysExpansion[1/EulerGamma, 35] (* Robert G. Wilson v, May 22 2014 *)
BlazysExpansion[n_, mx_] := Reap[Nest[(1/(#/Sow[Floor[#]] - 1)) &, n, mx]; ][[-1, 1]]; BlazysExpansion[1/EulerGamma, 35] (* Jan Mangaldan, Jan 04 2017 *)
PROG
(PARI) bx(x, nmax)={local(c, v, k); // Blazys expansion function
v = vector(nmax); c = x; for(k=1, nmax, v[k] = floor(c); c = v[k]/(c-v[k]); ); return (v); }
bx(1/Euler, 670) // Execution; use very high real precision
CROSSREFS
KEYWORD
nonn
AUTHOR
Stanislav Sykora, Jan 06 2014
STATUS
approved