egyptian_methods | R Documentation |
Generate Egyptian fractions with specialized methods.
egyptian_methods(a, b)
a, b |
integers, a != 1, a < b and a, b relatively prime. |
For a rational number 0 < a/b < 1
, generates Egyptian fractions
that is finds integers x1, x2, ..., xk
such that
a/b = 1/x1 + 1/x2 + ... + 1/xk
using the following methods:
‘greedy’
Fibonacci-Sylvester
Golomb (same as with Farey sequences)
continued fractions (not yet implemented)
No return value, all solutions found will be printed to the console.
https://www.ics.uci.edu/~eppstein/numth/egypt/
egyptian_complete
egyptian_methods(8, 11) # 8/11 = 1/2 + 1/5 + 1/37 + 1/4070 (Fibonacci-Sylvester) # 8/11 = 1/2 + 1/6 + 1/21 + 1/77 (Golomb-Farey) # Other solutions # 8/11 = 1/2 + 1/8 + 1/11 + 1/88 # 8/11 = 1/2 + 1/12 + 1/22 + 1/121
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.