OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
T. A. Pierce, On an algorithm and its use in approximating roots of algebraic equations, Am. Math. Monthly 36 (10) (1929) 523.
Eric Weisstein's World of Mathematics, Pierce Expansion.
EXAMPLE
0.9159... = 1/1 - 1/11 + 1/(11*13) - 1/(11*13*59) + 1/(11*13*59*582) - ...
MAPLE
Digits := 300: Pierce := proc(x) local resid, a, i, an ; resid := x ; a := [] ; for i from 1 do an := floor(1./resid) ; a := [op(a), an] ; resid := evalf(1.-an*resid) ; if ilog10( mul(i, i=a)) > 0.7*Digits then break ; fi ; od: RETURN(a) ; end: Pierce(Catalan);
MATHEMATICA
PierceExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Floor[1/Expand[1 - #[[1]] #[[2]]]], Expand[1 - #[[1]] #[[2]]]} &, {Floor[1/(A - Floor[A])], A - Floor[A]}, n - 1]]; PierceExp[N[Catalan , 7!], 20] (* G. C. Greubel, Nov 15 2016 *)
PROG
(PARI) r=1/Catalan; for(n=1, 10, print(floor(r), ", "); r=r/(r-floor(r))) \\ G. C. Greubel, Nov 15 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
R. J. Mathar, Nov 05 2007
STATUS
approved