i1 : egyptian = method(); |
i2 : egyptian QQ := x -> if x == 0 then 0 else (
n := ceiling(1/x);
expression(1/n) + egyptian(x - 1/n));
|
i3 : egyptian(30/31)
1 1 1 1 1 1
o3 = - + - + - + --- + ----- + ---------
2 3 8 107 15922 633759288
o3 : Expression of class Sum
|
The object expression is a method function with a single argument.