OFFSET
0,2
COMMENTS
Also, alternating Engel expansion for Pi.
Pi = 4 - 1/1 + 1/(1*7) - 1/(1*7*112) + 1/(1*7*112*115) - ...
Pierce expansions are always strictly increasing.
LINKS
G. C. Greubel and T. D. Noe, Table of n, a(n) for n = 0..1000 (terms 0 to 400 computed by T. D. Noe; terms 401 to 1000 computed by G. C. Greubel, Dec 31 2016)
Eric Weisstein's World of Mathematics, Pierce Expansion
MAPLE
Digits := 1000: x0 := 4-Pi-4^(-1000): x1 := 4-Pi+4^(-1000): ss := []: # when expansions of x0 and x1 differ, halt
k0 := floor(1/x0): k1 := floor(1/x1): while k0=k1 do ss := [op(ss), k0]: x0 := 1-k0*x0: x1 := 1-k1*x1: k0 := floor(1/x0): k1 := floor(1/x1): od:
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[4 - Pi, 7!], 25] (* G. C. Greubel, Dec 31 2016 *)
PROG
(PARI) A061233(N=199)={localprec(N); my(c=4-Pi, d=c+c/10^N, a=[1\c]); while(a[#a]==1\d&&c=1-c*a[#a], d=1-d*a[#a]; a=concat(a, 1\c)); a[^-1]} \\ optional arg fixes precision, roughly equal to total number of digits in the result. - M. F. Hasler, Nov 24 2020
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
Frank Ellermann, May 15 2001
EXTENSIONS
More terms from Eric Rains (rains(AT)caltech.edu), May 31 2001
STATUS
approved