|
|
A014012
|
|
Engel expansion of 1/Pi.
|
|
3
|
|
|
4, 4, 11, 45, 70, 1111, 4423, 5478, 49340, 94388, 200677, 308749, 708066, 711391, 1113024, 4342375, 4529119, 8061070, 12060867, 56215509, 69737317, 124001030, 214920537, 471564389, 891380746, 4293367334, 5031151602, 9832878719, 15034446439, 15481444638
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
MAPLE
|
a(n):=proc(s)
local
i, j, max, aa, bb, lll, prod, S, T, kk;
S := evalf(abs(s));
max := 10^(Digits - 10);
prod := 1;
lll := [];
while prod <= max do
T := 1 + trunc(1/S);
S := frac(S*T);
lll := [op(lll), T];
prod := prod*T
end do;
RETURN(lll)
end;
### Enter a real number and the program will return the Engel expansion of that number, the number of terms is adjusted to the output
|
|
MATHEMATICA
|
EngelExp[A_, n_]:=Join[Array[1&, Floor[A]], First@Transpose@NestList[{Ceiling[1/Expand[ #[[1]]#[[2]]-1]], Expand[ #[[1]]#[[2]]-1]}&, {Ceiling[1/(A-Floor[A])], A-Floor[A]}, n-1]]; EngelExp[N[1/Pi, 7! ], 50] (* Vladimir Joseph Stephan Orlovsky, Jun 08 2009 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|