egyptian_complete | R Documentation |
Generate all Egyptian fractions of length 2 and 3.
egyptian_complete(a, b, show = TRUE)
a, b |
integers, a != 1, a < b and a, b relatively prime. |
show |
logical; shall solutions found be printed? |
For a rational number 0 < a/b < 1
, generates all Egyptian fractions
of length 2 and three, that is finds integers x1, x2, x3
such that
a/b = 1/x1 + 1/x2
a/b = 1/x1 + 1/x2 + 1/x3
.
All solutions found will be printed to the console if show=TRUE
;
returns invisibly the number of solutions found.
https://www.ics.uci.edu/~eppstein/numth/egypt/
egyptian_methods
egyptian_complete(6, 7) # 1/2 + 1/3 + 1/42 egyptian_complete(8, 11) # no solution with 2 or 3 fractions # TODO # 2/9 = 1/9 + 1/10 + 1/90 # is not recognized, as similar cases, # because 1/n is not considered in m/n.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.