OFFSET
1,1
COMMENTS
Suppose that r is a sequence of rational numbers r(k) <= 1 for k >= 1, and that x is an irrational number in (0,1). Let f(0) = x, n(k) = floor(r(k)/f(k-1)), and f(k) = f(k-1) - r(k)/n(k). Then x = r(1)/n(1) + r(2)/n(2) + r(3)/n(3) + ... , the r-Egyptian fraction for x.
See A269993 for a guide to related sequences.
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..12
Eric Weisstein's World of Mathematics, Egyptian Fraction
EXAMPLE
sqrt(1/3) = 1/2 + 1/(2*7) + 1/(3*57) + ...
MATHEMATICA
r[k_] := 1/k; f[x_, 0] = x; z = 10;
n[x_, k_] := n[x, k] = Ceiling[r[k]/f[x, k - 1]]
f[x_, k_] := f[x, k] = f[x, k - 1] - r[k]/n[x, k]
x = Sqrt[1/3]; Table[n[x, k], {k, 1, z}]
PROG
(PARI) r(k) = 1/k;
x = sqrt(1/3);
f(x, k) = if(k<1, x, f(x, k - 1) - r(k)/n(x, k));
n(x, k) = ceil(r(k)/f(x, k - 1));
for(k = 1, 8, print1(n(x, k), ", ")) \\ Indranil Ghosh, Mar 27 2017, translated from Mathematica code
CROSSREFS
KEYWORD
nonn,frac,easy
AUTHOR
Clark Kimberling, Mar 15 2016
STATUS
approved