OFFSET
1,2
LINKS
Eric W. Weisstein, Engel Expansion
MAPLE
Digits := 5000:
a0 := evalf(BesselI(0, 2)/BesselI(1, 2)):
f1 := proc(n) local i, an, u, a:
an := [ ]:
u := n:
for i from 1 to 30 do
a := ceil(1/u):
an := [ op(an), a ]:
u := u * a - 1:
od:
RETURN (an): end: f1(a0);
PROG
(PARI) CFB(v)={ \\ converts a continued fraction to a number
my(x=v[#v]*1.);
forstep(i=#v-1, 1, -1,
x = v[i] + x^-1;
);
x
};
Engel(x)={
my(v=List(), t);
while(1,
trap(,
return(Vec(v))
,
t = ceil(1/x)
);
listput(v, t);
x = (x * t) - 1
)
};
\p 500
Engel(CFB(vector(500, i, i)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jani Melik, Feb 04 2011
EXTENSIONS
gp script from Charles R Greathouse IV, Feb 06 2011
STATUS
approved